media: ipu3-cio2: support multiple sensors and VCMs with same HID
authorBingbu Cao <bingbu.cao@intel.com>
Fri, 10 Mar 2023 15:19:10 +0000 (23:19 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 11 Apr 2023 16:54:01 +0000 (18:54 +0200)
commit567f97bd381fd79fa8563808118fc757cb6fa4ff
tree07cd5843b093166d2da169ad1e7fad46e6fce8cd
parentbd5a03bc5be8cc74c607896cb780a2819389a4dd
media: ipu3-cio2: support multiple sensors and VCMs with same HID

In current cio2-bridge, it is using the hid name to register software
node and software node will create kobject and sysfs entry according to
the node name, if there are multiple sensors and VCMs which are sharing
same HID name, it will cause the software nodes registration failure:

sysfs: cannot create duplicate filename '/kernel/software_nodes/dw9714'
...
Call Trace:
software_node_register_nodes
cio2_bridge_init
...
kobject_add_internal failed for dw9714 with -EEXIST,
don't try to register things with the same name in the same directory.

One solution is appending the sensor link(Mipi Port) in SSDB as suffix
of the node name to fix this problem.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/pci/intel/ipu3/cio2-bridge.c
drivers/media/pci/intel/ipu3/cio2-bridge.h