|
@@ -865,6 +865,41 @@ error:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+int v4l2_async_notifier_parse_fwnode_sensor_common(
|
|
|
+ struct device *dev, struct v4l2_async_notifier *notifier)
|
|
|
+{
|
|
|
+ static const char * const led_props[] = { "led" };
|
|
|
+ static const struct {
|
|
|
+ const char *name;
|
|
|
+ const char * const *props;
|
|
|
+ unsigned int nprops;
|
|
|
+ } props[] = {
|
|
|
+ { "flash-leds", led_props, ARRAY_SIZE(led_props) },
|
|
|
+ { "lens-focus", NULL, 0 },
|
|
|
+ };
|
|
|
+ unsigned int i;
|
|
|
+
|
|
|
+ for (i = 0; i < ARRAY_SIZE(props); i++) {
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ if (props[i].props && is_acpi_node(dev_fwnode(dev)))
|
|
|
+ ret = v4l2_fwnode_reference_parse_int_props(
|
|
|
+ dev, notifier, props[i].name,
|
|
|
+ props[i].props, props[i].nprops);
|
|
|
+ else
|
|
|
+ ret = v4l2_fwnode_reference_parse(
|
|
|
+ dev, notifier, props[i].name);
|
|
|
+ if (ret && ret != -ENOENT) {
|
|
|
+ dev_warn(dev, "parsing property \"%s\" failed (%d)\n",
|
|
|
+ props[i].name, ret);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(v4l2_async_notifier_parse_fwnode_sensor_common);
|
|
|
+
|
|
|
MODULE_LICENSE("GPL");
|
|
|
MODULE_AUTHOR("Sakari Ailus <sakari.ailus@linux.intel.com>");
|
|
|
MODULE_AUTHOR("Sylwester Nawrocki <s.nawrocki@samsung.com>");
|