18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * V4L2 asynchronous subdevice registration API 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2012-2013, Guennadi Liakhovetski <g.liakhovetski@gmx.de> 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifndef V4L2_ASYNC_H 98c2ecf20Sopenharmony_ci#define V4L2_ASYNC_H 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#include <linux/list.h> 128c2ecf20Sopenharmony_ci#include <linux/mutex.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_cistruct device; 158c2ecf20Sopenharmony_cistruct device_node; 168c2ecf20Sopenharmony_cistruct v4l2_device; 178c2ecf20Sopenharmony_cistruct v4l2_subdev; 188c2ecf20Sopenharmony_cistruct v4l2_async_notifier; 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/** 218c2ecf20Sopenharmony_ci * enum v4l2_async_match_type - type of asynchronous subdevice logic to be used 228c2ecf20Sopenharmony_ci * in order to identify a match 238c2ecf20Sopenharmony_ci * 248c2ecf20Sopenharmony_ci * @V4L2_ASYNC_MATCH_CUSTOM: Match will use the logic provided by &struct 258c2ecf20Sopenharmony_ci * v4l2_async_subdev.match ops 268c2ecf20Sopenharmony_ci * @V4L2_ASYNC_MATCH_DEVNAME: Match will use the device name 278c2ecf20Sopenharmony_ci * @V4L2_ASYNC_MATCH_I2C: Match will check for I2C adapter ID and address 288c2ecf20Sopenharmony_ci * @V4L2_ASYNC_MATCH_FWNODE: Match will use firmware node 298c2ecf20Sopenharmony_ci * 308c2ecf20Sopenharmony_ci * This enum is used by the asyncrhronous sub-device logic to define the 318c2ecf20Sopenharmony_ci * algorithm that will be used to match an asynchronous device. 328c2ecf20Sopenharmony_ci */ 338c2ecf20Sopenharmony_cienum v4l2_async_match_type { 348c2ecf20Sopenharmony_ci V4L2_ASYNC_MATCH_CUSTOM, 358c2ecf20Sopenharmony_ci V4L2_ASYNC_MATCH_DEVNAME, 368c2ecf20Sopenharmony_ci V4L2_ASYNC_MATCH_I2C, 378c2ecf20Sopenharmony_ci V4L2_ASYNC_MATCH_FWNODE, 388c2ecf20Sopenharmony_ci}; 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci/** 418c2ecf20Sopenharmony_ci * struct v4l2_async_subdev - sub-device descriptor, as known to a bridge 428c2ecf20Sopenharmony_ci * 438c2ecf20Sopenharmony_ci * @match_type: type of match that will be used 448c2ecf20Sopenharmony_ci * @match: union of per-bus type matching data sets 458c2ecf20Sopenharmony_ci * @match.fwnode: 468c2ecf20Sopenharmony_ci * pointer to &struct fwnode_handle to be matched. 478c2ecf20Sopenharmony_ci * Used if @match_type is %V4L2_ASYNC_MATCH_FWNODE. 488c2ecf20Sopenharmony_ci * @match.device_name: 498c2ecf20Sopenharmony_ci * string containing the device name to be matched. 508c2ecf20Sopenharmony_ci * Used if @match_type is %V4L2_ASYNC_MATCH_DEVNAME. 518c2ecf20Sopenharmony_ci * @match.i2c: embedded struct with I2C parameters to be matched. 528c2ecf20Sopenharmony_ci * Both @match.i2c.adapter_id and @match.i2c.address 538c2ecf20Sopenharmony_ci * should be matched. 548c2ecf20Sopenharmony_ci * Used if @match_type is %V4L2_ASYNC_MATCH_I2C. 558c2ecf20Sopenharmony_ci * @match.i2c.adapter_id: 568c2ecf20Sopenharmony_ci * I2C adapter ID to be matched. 578c2ecf20Sopenharmony_ci * Used if @match_type is %V4L2_ASYNC_MATCH_I2C. 588c2ecf20Sopenharmony_ci * @match.i2c.address: 598c2ecf20Sopenharmony_ci * I2C address to be matched. 608c2ecf20Sopenharmony_ci * Used if @match_type is %V4L2_ASYNC_MATCH_I2C. 618c2ecf20Sopenharmony_ci * @match.custom: 628c2ecf20Sopenharmony_ci * Driver-specific match criteria. 638c2ecf20Sopenharmony_ci * Used if @match_type is %V4L2_ASYNC_MATCH_CUSTOM. 648c2ecf20Sopenharmony_ci * @match.custom.match: 658c2ecf20Sopenharmony_ci * Driver-specific match function to be used if 668c2ecf20Sopenharmony_ci * %V4L2_ASYNC_MATCH_CUSTOM. 678c2ecf20Sopenharmony_ci * @match.custom.priv: 688c2ecf20Sopenharmony_ci * Driver-specific private struct with match parameters 698c2ecf20Sopenharmony_ci * to be used if %V4L2_ASYNC_MATCH_CUSTOM. 708c2ecf20Sopenharmony_ci * @asd_list: used to add struct v4l2_async_subdev objects to the 718c2ecf20Sopenharmony_ci * master notifier @asd_list 728c2ecf20Sopenharmony_ci * @list: used to link struct v4l2_async_subdev objects, waiting to be 738c2ecf20Sopenharmony_ci * probed, to a notifier->waiting list 748c2ecf20Sopenharmony_ci * 758c2ecf20Sopenharmony_ci * When this struct is used as a member in a driver specific struct, 768c2ecf20Sopenharmony_ci * the driver specific struct shall contain the &struct 778c2ecf20Sopenharmony_ci * v4l2_async_subdev as its first member. 788c2ecf20Sopenharmony_ci */ 798c2ecf20Sopenharmony_cistruct v4l2_async_subdev { 808c2ecf20Sopenharmony_ci enum v4l2_async_match_type match_type; 818c2ecf20Sopenharmony_ci union { 828c2ecf20Sopenharmony_ci struct fwnode_handle *fwnode; 838c2ecf20Sopenharmony_ci const char *device_name; 848c2ecf20Sopenharmony_ci struct { 858c2ecf20Sopenharmony_ci int adapter_id; 868c2ecf20Sopenharmony_ci unsigned short address; 878c2ecf20Sopenharmony_ci } i2c; 888c2ecf20Sopenharmony_ci struct { 898c2ecf20Sopenharmony_ci bool (*match)(struct device *dev, 908c2ecf20Sopenharmony_ci struct v4l2_async_subdev *sd); 918c2ecf20Sopenharmony_ci void *priv; 928c2ecf20Sopenharmony_ci } custom; 938c2ecf20Sopenharmony_ci } match; 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci /* v4l2-async core private: not to be used by drivers */ 968c2ecf20Sopenharmony_ci struct list_head list; 978c2ecf20Sopenharmony_ci struct list_head asd_list; 988c2ecf20Sopenharmony_ci}; 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci/** 1018c2ecf20Sopenharmony_ci * struct v4l2_async_notifier_operations - Asynchronous V4L2 notifier operations 1028c2ecf20Sopenharmony_ci * @bound: a subdevice driver has successfully probed one of the subdevices 1038c2ecf20Sopenharmony_ci * @complete: All subdevices have been probed successfully. The complete 1048c2ecf20Sopenharmony_ci * callback is only executed for the root notifier. 1058c2ecf20Sopenharmony_ci * @unbind: a subdevice is leaving 1068c2ecf20Sopenharmony_ci */ 1078c2ecf20Sopenharmony_cistruct v4l2_async_notifier_operations { 1088c2ecf20Sopenharmony_ci int (*bound)(struct v4l2_async_notifier *notifier, 1098c2ecf20Sopenharmony_ci struct v4l2_subdev *subdev, 1108c2ecf20Sopenharmony_ci struct v4l2_async_subdev *asd); 1118c2ecf20Sopenharmony_ci int (*complete)(struct v4l2_async_notifier *notifier); 1128c2ecf20Sopenharmony_ci void (*unbind)(struct v4l2_async_notifier *notifier, 1138c2ecf20Sopenharmony_ci struct v4l2_subdev *subdev, 1148c2ecf20Sopenharmony_ci struct v4l2_async_subdev *asd); 1158c2ecf20Sopenharmony_ci}; 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_ci/** 1188c2ecf20Sopenharmony_ci * struct v4l2_async_notifier - v4l2_device notifier data 1198c2ecf20Sopenharmony_ci * 1208c2ecf20Sopenharmony_ci * @ops: notifier operations 1218c2ecf20Sopenharmony_ci * @v4l2_dev: v4l2_device of the root notifier, NULL otherwise 1228c2ecf20Sopenharmony_ci * @sd: sub-device that registered the notifier, NULL otherwise 1238c2ecf20Sopenharmony_ci * @parent: parent notifier 1248c2ecf20Sopenharmony_ci * @asd_list: master list of struct v4l2_async_subdev 1258c2ecf20Sopenharmony_ci * @waiting: list of struct v4l2_async_subdev, waiting for their drivers 1268c2ecf20Sopenharmony_ci * @done: list of struct v4l2_subdev, already probed 1278c2ecf20Sopenharmony_ci * @list: member in a global list of notifiers 1288c2ecf20Sopenharmony_ci */ 1298c2ecf20Sopenharmony_cistruct v4l2_async_notifier { 1308c2ecf20Sopenharmony_ci const struct v4l2_async_notifier_operations *ops; 1318c2ecf20Sopenharmony_ci struct v4l2_device *v4l2_dev; 1328c2ecf20Sopenharmony_ci struct v4l2_subdev *sd; 1338c2ecf20Sopenharmony_ci struct v4l2_async_notifier *parent; 1348c2ecf20Sopenharmony_ci struct list_head asd_list; 1358c2ecf20Sopenharmony_ci struct list_head waiting; 1368c2ecf20Sopenharmony_ci struct list_head done; 1378c2ecf20Sopenharmony_ci struct list_head list; 1388c2ecf20Sopenharmony_ci}; 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ci/** 1418c2ecf20Sopenharmony_ci * v4l2_async_notifier_init - Initialize a notifier. 1428c2ecf20Sopenharmony_ci * 1438c2ecf20Sopenharmony_ci * @notifier: pointer to &struct v4l2_async_notifier 1448c2ecf20Sopenharmony_ci * 1458c2ecf20Sopenharmony_ci * This function initializes the notifier @asd_list. It must be called 1468c2ecf20Sopenharmony_ci * before the first call to @v4l2_async_notifier_add_subdev. 1478c2ecf20Sopenharmony_ci */ 1488c2ecf20Sopenharmony_civoid v4l2_async_notifier_init(struct v4l2_async_notifier *notifier); 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_ci/** 1518c2ecf20Sopenharmony_ci * v4l2_async_notifier_add_subdev - Add an async subdev to the 1528c2ecf20Sopenharmony_ci * notifier's master asd list. 1538c2ecf20Sopenharmony_ci * 1548c2ecf20Sopenharmony_ci * @notifier: pointer to &struct v4l2_async_notifier 1558c2ecf20Sopenharmony_ci * @asd: pointer to &struct v4l2_async_subdev 1568c2ecf20Sopenharmony_ci * 1578c2ecf20Sopenharmony_ci * Call this function before registering a notifier to link the provided @asd to 1588c2ecf20Sopenharmony_ci * the notifiers master @asd_list. The @asd must be allocated with k*alloc() as 1598c2ecf20Sopenharmony_ci * it will be freed by the framework when the notifier is destroyed. 1608c2ecf20Sopenharmony_ci */ 1618c2ecf20Sopenharmony_ciint v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier, 1628c2ecf20Sopenharmony_ci struct v4l2_async_subdev *asd); 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci/** 1658c2ecf20Sopenharmony_ci * v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async 1668c2ecf20Sopenharmony_ci * subdev to the notifier's master asd_list. 1678c2ecf20Sopenharmony_ci * 1688c2ecf20Sopenharmony_ci * @notifier: pointer to &struct v4l2_async_notifier 1698c2ecf20Sopenharmony_ci * @fwnode: fwnode handle of the sub-device to be matched 1708c2ecf20Sopenharmony_ci * @asd_struct_size: size of the driver's async sub-device struct, including 1718c2ecf20Sopenharmony_ci * sizeof(struct v4l2_async_subdev). The &struct 1728c2ecf20Sopenharmony_ci * v4l2_async_subdev shall be the first member of 1738c2ecf20Sopenharmony_ci * the driver's async sub-device struct, i.e. both 1748c2ecf20Sopenharmony_ci * begin at the same memory address. 1758c2ecf20Sopenharmony_ci * 1768c2ecf20Sopenharmony_ci * Allocate a fwnode-matched asd of size asd_struct_size, and add it to the 1778c2ecf20Sopenharmony_ci * notifiers @asd_list. The function also gets a reference of the fwnode which 1788c2ecf20Sopenharmony_ci * is released later at notifier cleanup time. 1798c2ecf20Sopenharmony_ci */ 1808c2ecf20Sopenharmony_cistruct v4l2_async_subdev * 1818c2ecf20Sopenharmony_civ4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier, 1828c2ecf20Sopenharmony_ci struct fwnode_handle *fwnode, 1838c2ecf20Sopenharmony_ci unsigned int asd_struct_size); 1848c2ecf20Sopenharmony_ci 1858c2ecf20Sopenharmony_ci/** 1868c2ecf20Sopenharmony_ci * v4l2_async_notifier_add_fwnode_remote_subdev - Allocate and add a fwnode 1878c2ecf20Sopenharmony_ci * remote async subdev to the 1888c2ecf20Sopenharmony_ci * notifier's master asd_list. 1898c2ecf20Sopenharmony_ci * 1908c2ecf20Sopenharmony_ci * @notif: pointer to &struct v4l2_async_notifier 1918c2ecf20Sopenharmony_ci * @endpoint: local endpoint pointing to the remote sub-device to be matched 1928c2ecf20Sopenharmony_ci * @asd_struct_size: size of the driver's async sub-device struct, including 1938c2ecf20Sopenharmony_ci * sizeof(struct v4l2_async_subdev). The &struct 1948c2ecf20Sopenharmony_ci * v4l2_async_subdev shall be the first member of 1958c2ecf20Sopenharmony_ci * the driver's async sub-device struct, i.e. both 1968c2ecf20Sopenharmony_ci * begin at the same memory address. 1978c2ecf20Sopenharmony_ci * 1988c2ecf20Sopenharmony_ci * Gets the remote endpoint of a given local endpoint, set it up for fwnode 1998c2ecf20Sopenharmony_ci * matching and adds the async sub-device to the notifier's @asd_list. The 2008c2ecf20Sopenharmony_ci * function also gets a reference of the fwnode which is released later at 2018c2ecf20Sopenharmony_ci * notifier cleanup time. 2028c2ecf20Sopenharmony_ci * 2038c2ecf20Sopenharmony_ci * This is just like @v4l2_async_notifier_add_fwnode_subdev, but with the 2048c2ecf20Sopenharmony_ci * exception that the fwnode refers to a local endpoint, not the remote one. 2058c2ecf20Sopenharmony_ci */ 2068c2ecf20Sopenharmony_cistruct v4l2_async_subdev * 2078c2ecf20Sopenharmony_civ4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif, 2088c2ecf20Sopenharmony_ci struct fwnode_handle *endpoint, 2098c2ecf20Sopenharmony_ci unsigned int asd_struct_size); 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_ci/** 2128c2ecf20Sopenharmony_ci * v4l2_async_notifier_add_i2c_subdev - Allocate and add an i2c async 2138c2ecf20Sopenharmony_ci * subdev to the notifier's master asd_list. 2148c2ecf20Sopenharmony_ci * 2158c2ecf20Sopenharmony_ci * @notifier: pointer to &struct v4l2_async_notifier 2168c2ecf20Sopenharmony_ci * @adapter_id: I2C adapter ID to be matched 2178c2ecf20Sopenharmony_ci * @address: I2C address of sub-device to be matched 2188c2ecf20Sopenharmony_ci * @asd_struct_size: size of the driver's async sub-device struct, including 2198c2ecf20Sopenharmony_ci * sizeof(struct v4l2_async_subdev). The &struct 2208c2ecf20Sopenharmony_ci * v4l2_async_subdev shall be the first member of 2218c2ecf20Sopenharmony_ci * the driver's async sub-device struct, i.e. both 2228c2ecf20Sopenharmony_ci * begin at the same memory address. 2238c2ecf20Sopenharmony_ci * 2248c2ecf20Sopenharmony_ci * Same as above but for I2C matched sub-devices. 2258c2ecf20Sopenharmony_ci */ 2268c2ecf20Sopenharmony_cistruct v4l2_async_subdev * 2278c2ecf20Sopenharmony_civ4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier, 2288c2ecf20Sopenharmony_ci int adapter_id, unsigned short address, 2298c2ecf20Sopenharmony_ci unsigned int asd_struct_size); 2308c2ecf20Sopenharmony_ci 2318c2ecf20Sopenharmony_ci/** 2328c2ecf20Sopenharmony_ci * v4l2_async_notifier_add_devname_subdev - Allocate and add a device-name 2338c2ecf20Sopenharmony_ci * async subdev to the notifier's master asd_list. 2348c2ecf20Sopenharmony_ci * 2358c2ecf20Sopenharmony_ci * @notifier: pointer to &struct v4l2_async_notifier 2368c2ecf20Sopenharmony_ci * @device_name: device name string to be matched 2378c2ecf20Sopenharmony_ci * @asd_struct_size: size of the driver's async sub-device struct, including 2388c2ecf20Sopenharmony_ci * sizeof(struct v4l2_async_subdev). The &struct 2398c2ecf20Sopenharmony_ci * v4l2_async_subdev shall be the first member of 2408c2ecf20Sopenharmony_ci * the driver's async sub-device struct, i.e. both 2418c2ecf20Sopenharmony_ci * begin at the same memory address. 2428c2ecf20Sopenharmony_ci * 2438c2ecf20Sopenharmony_ci * Same as above but for device-name matched sub-devices. 2448c2ecf20Sopenharmony_ci */ 2458c2ecf20Sopenharmony_cistruct v4l2_async_subdev * 2468c2ecf20Sopenharmony_civ4l2_async_notifier_add_devname_subdev(struct v4l2_async_notifier *notifier, 2478c2ecf20Sopenharmony_ci const char *device_name, 2488c2ecf20Sopenharmony_ci unsigned int asd_struct_size); 2498c2ecf20Sopenharmony_ci 2508c2ecf20Sopenharmony_ci/** 2518c2ecf20Sopenharmony_ci * v4l2_async_notifier_register - registers a subdevice asynchronous notifier 2528c2ecf20Sopenharmony_ci * 2538c2ecf20Sopenharmony_ci * @v4l2_dev: pointer to &struct v4l2_device 2548c2ecf20Sopenharmony_ci * @notifier: pointer to &struct v4l2_async_notifier 2558c2ecf20Sopenharmony_ci */ 2568c2ecf20Sopenharmony_ciint v4l2_async_notifier_register(struct v4l2_device *v4l2_dev, 2578c2ecf20Sopenharmony_ci struct v4l2_async_notifier *notifier); 2588c2ecf20Sopenharmony_ci 2598c2ecf20Sopenharmony_ci/** 2608c2ecf20Sopenharmony_ci * v4l2_async_subdev_notifier_register - registers a subdevice asynchronous 2618c2ecf20Sopenharmony_ci * notifier for a sub-device 2628c2ecf20Sopenharmony_ci * 2638c2ecf20Sopenharmony_ci * @sd: pointer to &struct v4l2_subdev 2648c2ecf20Sopenharmony_ci * @notifier: pointer to &struct v4l2_async_notifier 2658c2ecf20Sopenharmony_ci */ 2668c2ecf20Sopenharmony_ciint v4l2_async_subdev_notifier_register(struct v4l2_subdev *sd, 2678c2ecf20Sopenharmony_ci struct v4l2_async_notifier *notifier); 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_ci/** 2708c2ecf20Sopenharmony_ci * v4l2_async_notifier_unregister - unregisters a subdevice 2718c2ecf20Sopenharmony_ci * asynchronous notifier 2728c2ecf20Sopenharmony_ci * 2738c2ecf20Sopenharmony_ci * @notifier: pointer to &struct v4l2_async_notifier 2748c2ecf20Sopenharmony_ci */ 2758c2ecf20Sopenharmony_civoid v4l2_async_notifier_unregister(struct v4l2_async_notifier *notifier); 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ci/** 2788c2ecf20Sopenharmony_ci * v4l2_async_notifier_cleanup - clean up notifier resources 2798c2ecf20Sopenharmony_ci * @notifier: the notifier the resources of which are to be cleaned up 2808c2ecf20Sopenharmony_ci * 2818c2ecf20Sopenharmony_ci * Release memory resources related to a notifier, including the async 2828c2ecf20Sopenharmony_ci * sub-devices allocated for the purposes of the notifier but not the notifier 2838c2ecf20Sopenharmony_ci * itself. The user is responsible for calling this function to clean up the 2848c2ecf20Sopenharmony_ci * notifier after calling 2858c2ecf20Sopenharmony_ci * @v4l2_async_notifier_add_subdev, 2868c2ecf20Sopenharmony_ci * @v4l2_async_notifier_parse_fwnode_endpoints or 2878c2ecf20Sopenharmony_ci * @v4l2_fwnode_reference_parse_sensor_common. 2888c2ecf20Sopenharmony_ci * 2898c2ecf20Sopenharmony_ci * There is no harm from calling v4l2_async_notifier_cleanup in other 2908c2ecf20Sopenharmony_ci * cases as long as its memory has been zeroed after it has been 2918c2ecf20Sopenharmony_ci * allocated. 2928c2ecf20Sopenharmony_ci */ 2938c2ecf20Sopenharmony_civoid v4l2_async_notifier_cleanup(struct v4l2_async_notifier *notifier); 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_ci/** 2968c2ecf20Sopenharmony_ci * v4l2_async_register_subdev - registers a sub-device to the asynchronous 2978c2ecf20Sopenharmony_ci * subdevice framework 2988c2ecf20Sopenharmony_ci * 2998c2ecf20Sopenharmony_ci * @sd: pointer to &struct v4l2_subdev 3008c2ecf20Sopenharmony_ci */ 3018c2ecf20Sopenharmony_ciint v4l2_async_register_subdev(struct v4l2_subdev *sd); 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci/** 3048c2ecf20Sopenharmony_ci * v4l2_async_register_subdev_sensor_common - registers a sensor sub-device to 3058c2ecf20Sopenharmony_ci * the asynchronous sub-device 3068c2ecf20Sopenharmony_ci * framework and parse set up common 3078c2ecf20Sopenharmony_ci * sensor related devices 3088c2ecf20Sopenharmony_ci * 3098c2ecf20Sopenharmony_ci * @sd: pointer to struct &v4l2_subdev 3108c2ecf20Sopenharmony_ci * 3118c2ecf20Sopenharmony_ci * This function is just like v4l2_async_register_subdev() with the exception 3128c2ecf20Sopenharmony_ci * that calling it will also parse firmware interfaces for remote references 3138c2ecf20Sopenharmony_ci * using v4l2_async_notifier_parse_fwnode_sensor_common() and registers the 3148c2ecf20Sopenharmony_ci * async sub-devices. The sub-device is similarly unregistered by calling 3158c2ecf20Sopenharmony_ci * v4l2_async_unregister_subdev(). 3168c2ecf20Sopenharmony_ci * 3178c2ecf20Sopenharmony_ci * While registered, the subdev module is marked as in-use. 3188c2ecf20Sopenharmony_ci * 3198c2ecf20Sopenharmony_ci * An error is returned if the module is no longer loaded on any attempts 3208c2ecf20Sopenharmony_ci * to register it. 3218c2ecf20Sopenharmony_ci */ 3228c2ecf20Sopenharmony_ciint __must_check 3238c2ecf20Sopenharmony_civ4l2_async_register_subdev_sensor_common(struct v4l2_subdev *sd); 3248c2ecf20Sopenharmony_ci 3258c2ecf20Sopenharmony_ci/** 3268c2ecf20Sopenharmony_ci * v4l2_async_unregister_subdev - unregisters a sub-device to the asynchronous 3278c2ecf20Sopenharmony_ci * subdevice framework 3288c2ecf20Sopenharmony_ci * 3298c2ecf20Sopenharmony_ci * @sd: pointer to &struct v4l2_subdev 3308c2ecf20Sopenharmony_ci */ 3318c2ecf20Sopenharmony_civoid v4l2_async_unregister_subdev(struct v4l2_subdev *sd); 3328c2ecf20Sopenharmony_ci#endif 333