platform/x86: Add AMD ISP platform config for OV05C10
PATCH v12 1/1 platform/x86: Add AMD ISP platform config for OV05C10
ISP device specific configuration is not available in ACPI. Add swnode graph to configure the missing device properties for the OV05C10 camera device supported on amdisp platform.
Add support to create i2c-client dynamically when amdisp i2c adapter is available.
---
Changes v11 -> v12:
* Add missing space before the open parenthesis '('
drivers/platform/x86/amd/Kconfig | 11 ++ drivers/platform/x86/amd/Makefile | 1 + drivers/platform/x86/amd/amd_isp4.c | 280 ++++++++++++++++++++++++++++ 3 files changed, 292 insertions(+) create mode 100644 drivers/platform/x86/amd/amd_isp4.c
drivers/platform/x86/amd/Kconfig +11 -0
@@ -32,3 +32,14 @@ config AMD_WBRF This mechanism will only be activated on platforms that advertise a need for it. + +config AMD_ISP_PLATFORM + tristate "AMD ISP4 platform driver" + depends on I2C && X86_64 && ACPI + help + Platform driver for AMD platforms containing image signal processor + gen 4. Provides camera sensor module board information to allow + sensor and V4L drivers to work properly. + + This driver can also be built as a module. If so, the module + will be called amd_isp4.
drivers/platform/x86/amd/Makefile +1 -0
@@ -10,3 +10,4 @@ obj-$(CONFIG_AMD_PMC) += pmc/ obj-$(CONFIG_AMD_HSMP) += hsmp/ obj-$(CONFIG_AMD_PMF) += pmf/ obj-$(CONFIG_AMD_WBRF) += wbrf.o +obj-$(CONFIG_AMD_ISP_PLATFORM) += amd_isp4.o
drivers/platform/x86/amd/amd_isp4.c new file +280 -0
280 lines not on this page · raw message
Signature · 1 line
2.43.0
drivers/platform/x86/amd/amd_isp4.c line 18
Quoted 5 lines
drivers/platform/x86/amd/amd_isp4.c new file +5
-0+#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10" +#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4"
Hey folks, I know v12 might be a bit too late for this one, but I've got another device here (Asus GZ302EA tablet) with a very similar camera setup, but a different sensor (OV13B10), and it looks like this driver just assumes a certain hardcoded configuration... I wonder if it makes sense to reorganize the code so that more sensor configurations can be added without making a separate module? I'd be happy to help with refactoring/testing/etc, if people are interested.
Ilpo Järvinen
maintainerQuoted 6 lines · Ilya K
drivers/platform/x86/amd/amd_isp4.c line 18
Quoted 5 lines
drivers/platform/x86/amd/amd_isp4.c new file +5
-0+#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10" +#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4"
Quoted 7 lines
Hey folks, I know v12 might be a bit too late for this one, but I've got another device here (Asus GZ302EA tablet) with a very similar camera setup, but a different sensor (OV13B10), and it looks like this driver just assumes a certain hardcoded configuration... I wonder if it makes sense to reorganize the code so that more sensor configurations can be added without making a separate module? I'd be happy to help with refactoring/testing/etc, if people are interested.
v12 is not too late, and besides, v9..v12 has happened within 5 days which is rather short time (hint to the submitter that there's no need to burn patch series version numbers at that speed :-)).
I'll give folks some time to sort this out if you need to add e.g., some driver_data instead.
Signature · 1 line
i.
Quoted 23 lines · Ilpo Järvinen
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Quoted 6 lines · Ilya K
drivers/platform/x86/amd/amd_isp4.c line 18
Quoted 5 lines
drivers/platform/x86/amd/amd_isp4.c new file +5
-0+#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10" +#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4"Quoted 7 lines
Hey folks, I know v12 might be a bit too late for this one, but I've got another device here (Asus GZ302EA tablet) with a very similar camera setup, but a different sensor (OV13B10), and it looks like this driver just assumes a certain hardcoded configuration... I wonder if it makes sense to reorganize the code so that more sensor configurations can be added without making a separate module? I'd be happy to help with refactoring/testing/etc, if people are interested.
v12 is not too late, and besides, v9..v12 has happened within 5 days which is rather short time (hint to the submitter that there's no need to burn patch series version numbers at that speed :-)).
Quoted 6 lines
I'll give folks some time to sort this out if you need to add e.g., some
driver_datainstead.--
i.
Hi Ilya, Ilpo,
I agree with the suggestion, but how about taking-up the refactoring part in a separate patch. Yes this patch focussed on supporting OV05C10 and even the code review proceeded with this understanding. Refactoring now for generic support would require changes that would undo some of the recent review feedback (especially related to global variables usage). Please let us know what do you think.
Thanks,
Pratap
Ilpo Järvinen
maintainerQuoted 31 lines · Pratap
Quoted 24 lines · Ilpo Järvinen
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Quoted 6 lines · Ilya K
drivers/platform/x86/amd/amd_isp4.c line 18
Quoted 5 lines
drivers/platform/x86/amd/amd_isp4.c new file +5
-0+#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10" +#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4"Quoted 7 lines
Hey folks, I know v12 might be a bit too late for this one, but I've got another device here (Asus GZ302EA tablet) with a very similar camera setup, but a different sensor (OV13B10), and it looks like this driver just assumes a certain hardcoded configuration... I wonder if it makes sense to reorganize the code so that more sensor configurations can be added without making a separate module? I'd be happy to help with refactoring/testing/etc, if people are interested.
v12 is not too late, and besides, v9..v12 has happened within 5 days which is rather short time (hint to the submitter that there's no need to burn patch series version numbers at that speed :-)).
Quoted 6 lines
I'll give folks some time to sort this out if you need to add e.g., some
driver_datainstead.--
i.
Quoted 8 lines
Hi Ilya, Ilpo,
I agree with the suggestion, but how about taking-up the refactoring part in a separate patch. Yes this patch focussed on supporting OV05C10 and even the code review proceeded with this understanding. Refactoring now for generic support would require changes that would undo some of the recent review feedback (especially related to global variables usage). Please let us know what do you think.
Hi,
If you refer to comments given to v7 that resulted in removal of swnodes field from struct amdisp_platform (and some other fields along with it), I don't think the comment was given to mean that you could not have platform info structure (const struct amdisp_platform_info that never was been there) but that it should be separate struct from the runtime one (struct amdisp_platform). The runtime struct can have a pointer to the info struct if it's content is needed after probe.
When the platform info struct exists, pointer to it can be put into driver_data in amdisp_sensor_ids. I don't expect you to necessarily add the other sensor there but I'd like to see this adapted such that it can be relatively easily added which likely requires having that separate struct for platform info.
So in a sense, it undoes some of the changes done after v7 but looking into history of this patch, it looks the post v7 patches went slightly into wrong direction which makes adding next device harder than it needs to be (I'm sorry I didn't realize this sooner). TBH, I don't think adding the info struct is that much extra effort for you given what you had in v7, the info just needs another struct separate from struct amdisp_platform but the ingrediments kind of where there already.
Signature · 1 line
i.
Hi Ilpo,
Quoted 60 lines · Ilpo Järvinen
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Quoted 31 lines · Pratap
Quoted 24 lines · Ilpo Järvinen
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Quoted 6 lines · Ilya K
drivers/platform/x86/amd/amd_isp4.c line 18
Quoted 5 lines
drivers/platform/x86/amd/amd_isp4.c new file +5
-0+#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10" +#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4"Quoted 7 lines
Hey folks, I know v12 might be a bit too late for this one, but I've got another device here (Asus GZ302EA tablet) with a very similar camera setup, but a different sensor (OV13B10), and it looks like this driver just assumes a certain hardcoded configuration... I wonder if it makes sense to reorganize the code so that more sensor configurations can be added without making a separate module? I'd be happy to help with refactoring/testing/etc, if people are interested.
v12 is not too late, and besides, v9..v12 has happened within 5 days which is rather short time (hint to the submitter that there's no need to burn patch series version numbers at that speed :-)).
Quoted 6 lines
I'll give folks some time to sort this out if you need to add e.g., some
driver_datainstead.--
i.Quoted 8 lines
Hi Ilya, Ilpo,
I agree with the suggestion, but how about taking-up the refactoring part in a separate patch. Yes this patch focussed on supporting OV05C10 and even the code review proceeded with this understanding. Refactoring now for generic support would require changes that would undo some of the recent review feedback (especially related to global variables usage). Please let us know what do you think.
Hi,
If you refer to comments given to v7 that resulted in removal of swnodes field from struct
amdisp_platform(and some other fields along with it), I don't think the comment was given to mean that you could not have platform info structure (const structamdisp_platform_infothat never was been there) but that it should be separate struct from the runtime one (structamdisp_platform). The runtime struct can have a pointer to the info struct if it's content is needed after probe.When the platform info struct exists, pointer to it can be put into
driver_datainamdisp_sensor_ids. I don't expect you to necessarily add the other sensor there but I'd like to see this adapted such that it can be relatively easily added which likely requires having that separate struct for platform info.
Quoted 8 lines
So in a sense, it undoes some of the changes done after v7 but looking into history of this patch, it looks the post v7 patches went slightly into wrong direction which makes adding next device harder than it needs to be (I'm sorry I didn't realize this sooner). TBH, I don't think adding the info struct is that much extra effort for you given what you had in v7, the info just needs another struct separate from struct
amdisp_platformbut the ingrediments kind of where there already.
Thanks for clarifying and providing direction. I agree adding the new amdisp_platform_info structure should be straightforward. I will implement the changes and submit the new patch v13.
Thanks,
Pratap
Quoted 2 lines
--
i.
Ilpo Järvinen
maintainerQuoted 76 lines · Pratap Nirujogi
ISP device specific configuration is not available in ACPI. Add swnode graph to configure the missing device properties for the OV05C10 camera device supported on amdisp platform.
Add support to create i2c-client dynamically when amdisp i2c adapter is available.
Co-developed-by Benjamin Chan <[email protected]>Signed-off-by Benjamin Chan <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Reviewed-by Hans de Goede <[email protected]>Reviewed-by Armin Wolf <[email protected]>Signed-off-by Pratap Nirujogi <[email protected]>---
Changes v11 -> v12:* Add missing space before the open parenthesis '('
drivers/platform/x86/amd/Kconfig | 11 ++ drivers/platform/x86/amd/Makefile | 1 + drivers/platform/x86/amd/amd_isp4.c | 280 ++++++++++++++++++++++++++++ 3 files changed, 292 insertions(+) create mode 100644 drivers/platform/x86/amd/amd_isp4.cdrivers/platform/x86/amd/Kconfig +11
-0@@ -32,3 +32,14 @@ config AMD_WBRF This mechanism will only be activated on platforms that advertise a need for it. + +config AMD_ISP_PLATFORM + tristate "AMD ISP4 platform driver" + depends on I2C && X86_64 && ACPI + help + Platform driver for AMD platforms containing image signal processor + gen 4. Provides camera sensor module board information to allow + sensor and V4L drivers to work properly. + + This driver can also be built as a module. If so, the module + will be called amd_isp4.drivers/platform/x86/amd/Makefile +1
-0@@ -10,3 +10,4 @@ obj-$(CONFIG_AMD_PMC) += pmc/ obj-$(CONFIG_AMD_HSMP) += hsmp/ obj-$(CONFIG_AMD_PMF) += pmf/ obj-$(CONFIG_AMD_WBRF) += wbrf.o +obj-$(CONFIG_AMD_ISP_PLATFORM) += amd_isp4.odrivers/platform/x86/amd/amd_isp4.c new file +18
-0@@ -0,0 +1,280 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* AMD ISP platform driver for sensor i2-client instantiation +* +* Copyright 2025 Advanced Micro Devices, Inc. +*/ + +#include <linux/i2c.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/property.h> +#include <linux/units.h> + +#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10" +#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4"
drivers/platform/x86/amd/amd_isp4.c line 28
Quoted 10 lines
drivers/platform/x86/amd/amd_isp4.c new file +10
-0+ +/* +* AMD ISP platform definition to configure the device properties +* missing in the ACPI table. +*/ +struct amdisp_platform { +struct i2c_board_info board_info; +struct notifier_block i2c_nb; +struct i2c_client *i2c_dev; +struct mutex lock;/* protects i2c client creation */
Please add one tab before the comment such that it moves a bit more right.
Quoted 165 lines
drivers/platform/x86/amd/amd_isp4.c new file +165
-0+}; + +/* Top-level OV05C10 camera node property table */ +static const struct property_entry ov05c10_camera_props[] = { +PROPERTY_ENTRY_U32 ("clock-frequency" ,24 *HZ_PER_MHZ ), + { } +}; + +/* Root AMD ISP OV05C10 camera node definition */ +static const struct software_node camera_node = { + .name =AMDISP_OV05C10_HID , + .properties = ov05c10_camera_props, +}; + +/* +* AMD ISP OV05C10 Ports node definition. No properties defined for +* ports node for OV05C10. +*/ +static const struct software_node ports = { + .name ="ports" , + .parent = &camera_node, +}; + +/* +* AMD ISP OV05C10 Port node definition. No properties defined for +* port node for OV05C10. +*/ +static const struct software_node port_node = { + .name ="port@" , + .parent = &ports, +}; + +/* +* Remote endpoint AMD ISP node definition. No properties defined for +* remote endpoint node for OV05C10. +*/ +static const struct software_node remote_ep_isp_node = { + .name =AMDISP_OV05C10_REMOTE_EP_NAME , +}; + +/* +* Remote endpoint reference for isp node included in the +* OV05C10 endpoint. +*/ +static const struct software_node_ref_args ov05c10_refs[] = { +SOFTWARE_NODE_REFERENCE (&remote_ep_isp_node), +}; + +/* OV05C supports one single link frequency */ +static const u64 ov05c10_link_freqs[] = { +925 *HZ_PER_MHZ , +}; + +/* OV05C supports only 2-lane configuration */ +static const u32 ov05c10_data_lanes[] = { +1 , +2 , +}; + +/* OV05C10 endpoint node properties table */ +static const struct property_entry ov05c10_endpoint_props[] = { +PROPERTY_ENTRY_U32 ("bus-type" ,4 ), +PROPERTY_ENTRY_U32_ARRAY_LEN ("data-lanes" , ov05c10_data_lanes, +ARRAY_SIZE (ov05c10_data_lanes)), +PROPERTY_ENTRY_U64_ARRAY_LEN ("link-frequencies" , ov05c10_link_freqs, +ARRAY_SIZE (ov05c10_link_freqs)), +PROPERTY_ENTRY_REF_ARRAY ("remote-endpoint" , ov05c10_refs), + { } +}; + +/* AMD ISP endpoint node definition */ +static const struct software_node endpoint_node = { + .name ="endpoint" , + .parent = &port_node, + .properties = ov05c10_endpoint_props, +}; + +/* +* AMD ISP swnode graph uses 5 nodes and also its relationship is +* fixed to align with the structure that v4l2 expects for successful +* endpoint fwnode parsing. +* +* It is only the node property_entries that will vary for each platform +* supporting different sensor modules. +*/ +#define NUM_SW_NODES 5 + +static const struct software_node *ov05c10_nodes[NUM_SW_NODES +1 ] = { + &camera_node, + &ports, + &port_node, + &endpoint_node, + &remote_ep_isp_node, +NULL +}; + +static const struct acpi_device_id amdisp_sensor_ids[] = { + {AMDISP_OV05C10_HID }, + { } +}; +MODULE_DEVICE_TABLE (acpi, amdisp_sensor_ids); + +static inline bool is_isp_i2c_adapter (struct i2c_adapter *adap) +{ +return !strcmp (adap->owner->name,"i2c_designware_amdisp" ); +} + +static void instantiate_isp_i2c_client (struct amdisp_platform *ov05c10,struct i2c_adapter *adap) +{ +struct i2c_board_info *info = &ov05c10->board_info; +struct i2c_client *i2c_dev; + +guard (mutex)(&ov05c10->lock); + +if (ov05c10->i2c_dev) +return ; + + i2c_dev =i2c_new_client_device (adap, info); +if (IS_ERR (i2c_dev)) { +dev_err (&adap->dev,"error %pe registering isp i2c_client\n" , i2c_dev); +return ; + } + ov05c10->i2c_dev = i2c_dev; +} + +static int isp_i2c_bus_notify (struct notifier_block *nb, +unsigned long action,void *data) +{ + struct amdisp_platform *ov05c10 = container_of(nb, struct amdisp_platform, i2c_nb); +struct device *dev = data; +struct i2c_client *client; +struct i2c_adapter *adap; + +switch (action) { +case BUS_NOTIFY_ADD_DEVICE : + adap =i2c_verify_adapter (dev); +if (!adap) +break ; +if (is_isp_i2c_adapter (adap)) +instantiate_isp_i2c_client (ov05c10, adap); +break ; +case BUS_NOTIFY_REMOVED_DEVICE : + client =i2c_verify_client (dev); +if (!client) +break ; + + scoped_guard(mutex, &ov05c10->lock) { +if (ov05c10->i2c_dev == client) { +dev_dbg (&client->adapter->dev,"amdisp i2c_client removed\n" ); + ov05c10->i2c_dev =NULL ; + } + } +break ; +default : +break ; + } + +return NOTIFY_DONE ; +} + +static struct amdisp_platform *prepare_amdisp_platform (struct device *dev) +{ +struct amdisp_platform *isp_ov05c10; +int ret; +
drivers/platform/x86/amd/amd_isp4.c line 203
Quoted 10 lines
drivers/platform/x86/amd/amd_isp4.c new file +10
-0+ isp_ov05c10 =devm_kzalloc (dev,sizeof (*isp_ov05c10),GFP_KERNEL ); +if (!isp_ov05c10) +return ERR_PTR (-ENOMEM ); + + ret =devm_mutex_init (dev, &isp_ov05c10->lock); +if (ret) +return ERR_PTR (ret); + + isp_ov05c10->board_info.dev_name ="ov05c10" ; +strscpy (isp_ov05c10->board_info.type,"ov05c10" ,I2C_NAME_SIZE );
There's some clever VA_ARGS magic in the strscpy() macro such that the size parameter is optional in many cases. Thus, in cases where the size parameter is the same as the size of the dst known to the compiler, please only provide dst and src to strscpy().
Signature · 1 line
i.
Quoted 78 lines
drivers/platform/x86/amd/amd_isp4.c new file +77
-0+ isp_ov05c10->board_info.addr =AMDISP_OV05C10_I2C_ADDR ; + + ret =software_node_register_node_group (ov05c10_nodes); +if (ret) +return ERR_PTR (ret); + + isp_ov05c10->board_info.swnode = ov05c10_nodes[0 ]; + +return isp_ov05c10; +} + +static int try_to_instantiate_i2c_client (struct device *dev,void *data) +{ +struct amdisp_platform *ov05c10 = (struct amdisp_platform *)data; +struct i2c_adapter *adap =i2c_verify_adapter (dev); + +if (!ov05c10 || !adap) +return 0 ; +if (!adap->owner) +return 0 ; + +if (is_isp_i2c_adapter (adap)) +instantiate_isp_i2c_client (ov05c10, adap); + +return 0 ; +} + +static int amd_isp_probe (struct platform_device *pdev) +{ +struct amdisp_platform *ov05c10; +int ret; + + ov05c10 =prepare_amdisp_platform (&pdev->dev); +if (IS_ERR (ov05c10)) +return dev_err_probe (&pdev->dev,PTR_ERR (ov05c10), +"failed to prepare AMD ISP platform fwnode\n" ); + + ov05c10->i2c_nb.notifier_call = isp_i2c_bus_notify; + ret =bus_register_notifier (&i2c_bus_type, &ov05c10->i2c_nb); +if (ret) + goto error_unregister_sw_node; + +/* check if adapter is already registered and create i2c client instance */ +i2c_for_each_dev ((void *)ov05c10, try_to_instantiate_i2c_client); + +platform_set_drvdata (pdev, ov05c10); +return 0 ; + +error_unregister_sw_node: +software_node_unregister_node_group (ov05c10_nodes); +return ret; +} + +static void amd_isp_remove (struct platform_device *pdev) +{ +struct amdisp_platform *ov05c10 =platform_get_drvdata (pdev); + +bus_unregister_notifier (&i2c_bus_type, &ov05c10->i2c_nb); +i2c_unregister_device (ov05c10->i2c_dev); +software_node_unregister_node_group (ov05c10_nodes); +} + +static struct platform_driver amd_isp_platform_driver = { + .driver = { + .name =AMD_ISP_PLAT_DRV_NAME , + .acpi_match_table = amdisp_sensor_ids, + }, + .probe = amd_isp_probe, + .remove = amd_isp_remove, +}; + +module_platform_driver (amd_isp_platform_driver); + +MODULE_AUTHOR ("Benjamin Chan <[email protected]>" ); +MODULE_AUTHOR ("Pratap Nirujogi <[email protected]>" ); +MODULE_DESCRIPTION ("AMD ISP4 Platform Driver" ); +MODULE_LICENSE ("GPL" );
Hi Ilpo,
Quoted 85 lines · Ilpo Järvinen
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Quoted 80 lines · Pratap Nirujogi
ISP device specific configuration is not available in ACPI. Add swnode graph to configure the missing device properties for the OV05C10 camera device supported on amdisp platform.
Add support to create i2c-client dynamically when amdisp i2c adapter is available.
Co-developed-by Benjamin Chan <[email protected]>Signed-off-by Benjamin Chan <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Reviewed-by Hans de Goede <[email protected]>Reviewed-by Armin Wolf <[email protected]>Signed-off-by Pratap Nirujogi <[email protected]>---
Changes v11 -> v12:* Add missing space before the open parenthesis '('
drivers/platform/x86/amd/Kconfig | 11 ++ drivers/platform/x86/amd/Makefile | 1 + drivers/platform/x86/amd/amd_isp4.c | 280 ++++++++++++++++++++++++++++ 3 files changed, 292 insertions(+)create mode 100644
drivers/platform/x86/amd/amd_isp4.cdrivers/platform/x86/amd/Kconfig +11
-0@@ -32,3 +32,14 @@ config AMD_WBRF This mechanism will only be activated on platforms that advertise a need for it. + +config AMD_ISP_PLATFORM + tristate "AMD ISP4 platform driver" + depends on I2C && X86_64 && ACPI + help + Platform driver for AMD platforms containing image signal processor + gen 4. Provides camera sensor module board information to allow + sensor and V4L drivers to work properly. + + This driver can also be built as a module. If so, the module + will be called amd_isp4.drivers/platform/x86/amd/Makefile +1
-0@@ -10,3 +10,4 @@ obj-$(CONFIG_AMD_PMC) += pmc/ obj-$(CONFIG_AMD_HSMP) += hsmp/ obj-$(CONFIG_AMD_PMF) += pmf/ obj-$(CONFIG_AMD_WBRF) += wbrf.o +obj-$(CONFIG_AMD_ISP_PLATFORM) += amd_isp4.odrivers/platform/x86/amd/amd_isp4.c new file +22
-0@@ -0,0 +1,280 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* AMD ISP platform driver for sensor i2-client instantiation +* +* Copyright 2025 Advanced Micro Devices, Inc. +*/ + +#include <linux/i2c.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/property.h> +#include <linux/units.h> + +#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10" +#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4" + +/* +* AMD ISP platform definition to configure the device properties +* missing in the ACPI table.
Quoted 9 lines
drivers/platform/x86/amd/amd_isp4.c line 28
Quoted 6 lines
drivers/platform/x86/amd/amd_isp4.c new file +6
-0+*/ +struct amdisp_platform { +struct i2c_board_info board_info; +struct notifier_block i2c_nb; +struct i2c_client *i2c_dev; +struct mutex lock;/* protects i2c client creation */ Please add one tab before the comment such that it moves a bit more right.
sure, will take care of it in next v13 patch.
Quoted 172 lines
Quoted 172 lines
drivers/platform/x86/amd/amd_isp4.c new file +172
-0+}; + +/* Top-level OV05C10 camera node property table */ +static const struct property_entry ov05c10_camera_props[] = { +PROPERTY_ENTRY_U32 ("clock-frequency" ,24 *HZ_PER_MHZ ), + { } +}; + +/* Root AMD ISP OV05C10 camera node definition */ +static const struct software_node camera_node = { + .name =AMDISP_OV05C10_HID , + .properties = ov05c10_camera_props, +}; + +/* +* AMD ISP OV05C10 Ports node definition. No properties defined for +* ports node for OV05C10. +*/ +static const struct software_node ports = { + .name ="ports" , + .parent = &camera_node, +}; + +/* +* AMD ISP OV05C10 Port node definition. No properties defined for +* port node for OV05C10. +*/ +static const struct software_node port_node = { + .name ="port@" , + .parent = &ports, +}; + +/* +* Remote endpoint AMD ISP node definition. No properties defined for +* remote endpoint node for OV05C10. +*/ +static const struct software_node remote_ep_isp_node = { + .name =AMDISP_OV05C10_REMOTE_EP_NAME , +}; + +/* +* Remote endpoint reference for isp node included in the +* OV05C10 endpoint. +*/ +static const struct software_node_ref_args ov05c10_refs[] = { +SOFTWARE_NODE_REFERENCE (&remote_ep_isp_node), +}; + +/* OV05C supports one single link frequency */ +static const u64 ov05c10_link_freqs[] = { +925 *HZ_PER_MHZ , +}; + +/* OV05C supports only 2-lane configuration */ +static const u32 ov05c10_data_lanes[] = { +1 , +2 , +}; + +/* OV05C10 endpoint node properties table */ +static const struct property_entry ov05c10_endpoint_props[] = { +PROPERTY_ENTRY_U32 ("bus-type" ,4 ), +PROPERTY_ENTRY_U32_ARRAY_LEN ("data-lanes" , ov05c10_data_lanes, +ARRAY_SIZE (ov05c10_data_lanes)), +PROPERTY_ENTRY_U64_ARRAY_LEN ("link-frequencies" , ov05c10_link_freqs, +ARRAY_SIZE (ov05c10_link_freqs)), +PROPERTY_ENTRY_REF_ARRAY ("remote-endpoint" , ov05c10_refs), + { } +}; + +/* AMD ISP endpoint node definition */ +static const struct software_node endpoint_node = { + .name ="endpoint" , + .parent = &port_node, + .properties = ov05c10_endpoint_props, +}; + +/* +* AMD ISP swnode graph uses 5 nodes and also its relationship is +* fixed to align with the structure that v4l2 expects for successful +* endpoint fwnode parsing. +* +* It is only the node property_entries that will vary for each platform +* supporting different sensor modules. +*/ +#define NUM_SW_NODES 5 + +static const struct software_node *ov05c10_nodes[NUM_SW_NODES +1 ] = { + &camera_node, + &ports, + &port_node, + &endpoint_node, + &remote_ep_isp_node, +NULL +}; + +static const struct acpi_device_id amdisp_sensor_ids[] = { + {AMDISP_OV05C10_HID }, + { } +}; +MODULE_DEVICE_TABLE (acpi, amdisp_sensor_ids); + +static inline bool is_isp_i2c_adapter (struct i2c_adapter *adap) +{ +return !strcmp (adap->owner->name,"i2c_designware_amdisp" ); +} + +static void instantiate_isp_i2c_client (struct amdisp_platform *ov05c10,struct i2c_adapter *adap) +{ +struct i2c_board_info *info = &ov05c10->board_info; +struct i2c_client *i2c_dev; + +guard (mutex)(&ov05c10->lock); + +if (ov05c10->i2c_dev) +return ; + + i2c_dev =i2c_new_client_device (adap, info); +if (IS_ERR (i2c_dev)) { +dev_err (&adap->dev,"error %pe registering isp i2c_client\n" , i2c_dev); +return ; + } + ov05c10->i2c_dev = i2c_dev; +} + +static int isp_i2c_bus_notify (struct notifier_block *nb, +unsigned long action,void *data) +{ + struct amdisp_platform *ov05c10 = container_of(nb, struct amdisp_platform, i2c_nb); +struct device *dev = data; +struct i2c_client *client; +struct i2c_adapter *adap; + +switch (action) { +case BUS_NOTIFY_ADD_DEVICE : + adap =i2c_verify_adapter (dev); +if (!adap) +break ; +if (is_isp_i2c_adapter (adap)) +instantiate_isp_i2c_client (ov05c10, adap); +break ; +case BUS_NOTIFY_REMOVED_DEVICE : + client =i2c_verify_client (dev); +if (!client) +break ; + + scoped_guard(mutex, &ov05c10->lock) { +if (ov05c10->i2c_dev == client) { +dev_dbg (&client->adapter->dev,"amdisp i2c_client removed\n" ); + ov05c10->i2c_dev =NULL ; + } + } +break ; +default : +break ; + } + +return NOTIFY_DONE ; +} + +static struct amdisp_platform *prepare_amdisp_platform (struct device *dev) +{ +struct amdisp_platform *isp_ov05c10; +int ret; + + isp_ov05c10 =devm_kzalloc (dev,sizeof (*isp_ov05c10),GFP_KERNEL ); +if (!isp_ov05c10) +return ERR_PTR (-ENOMEM ); + + ret =devm_mutex_init (dev, &isp_ov05c10->lock); +if (ret) +return ERR_PTR (ret);
Quoted 9 lines
drivers/platform/x86/amd/amd_isp4.c line 203
Quoted 3 lines
drivers/platform/x86/amd/amd_isp4.c new file +3
-0+ + isp_ov05c10->board_info.dev_name ="ov05c10" ; +strscpy (isp_ov05c10->board_info.type,"ov05c10" ,I2C_NAME_SIZE );There's some clever
VA_ARGSmagic in thestrscpy()macro such that the size parameter is optional in many cases. Thus, in cases where the size parameter is the same as the size of the dst known to the compiler, please only provide dst and src tostrscpy().
Thanks, good to know size parameter can be optional when src and dst sizes are same. Will remove size param in v13.
Thanks,
Pratap
Quoted 81 lines
--
i.Quoted 78 lines
drivers/platform/x86/amd/amd_isp4.c new file +77
-0+ isp_ov05c10->board_info.addr =AMDISP_OV05C10_I2C_ADDR ; + + ret =software_node_register_node_group (ov05c10_nodes); +if (ret) +return ERR_PTR (ret); + + isp_ov05c10->board_info.swnode = ov05c10_nodes[0 ]; + +return isp_ov05c10; +} + +static int try_to_instantiate_i2c_client (struct device *dev,void *data) +{ +struct amdisp_platform *ov05c10 = (struct amdisp_platform *)data; +struct i2c_adapter *adap =i2c_verify_adapter (dev); + +if (!ov05c10 || !adap) +return 0 ; +if (!adap->owner) +return 0 ; + +if (is_isp_i2c_adapter (adap)) +instantiate_isp_i2c_client (ov05c10, adap); + +return 0 ; +} + +static int amd_isp_probe (struct platform_device *pdev) +{ +struct amdisp_platform *ov05c10; +int ret; + + ov05c10 =prepare_amdisp_platform (&pdev->dev); +if (IS_ERR (ov05c10)) +return dev_err_probe (&pdev->dev,PTR_ERR (ov05c10), +"failed to prepare AMD ISP platform fwnode\n" ); + + ov05c10->i2c_nb.notifier_call = isp_i2c_bus_notify; + ret =bus_register_notifier (&i2c_bus_type, &ov05c10->i2c_nb); +if (ret) + goto error_unregister_sw_node; + +/* check if adapter is already registered and create i2c client instance */ +i2c_for_each_dev ((void *)ov05c10, try_to_instantiate_i2c_client); + +platform_set_drvdata (pdev, ov05c10); +return 0 ; + +error_unregister_sw_node: +software_node_unregister_node_group (ov05c10_nodes); +return ret; +} + +static void amd_isp_remove (struct platform_device *pdev) +{ +struct amdisp_platform *ov05c10 =platform_get_drvdata (pdev); + +bus_unregister_notifier (&i2c_bus_type, &ov05c10->i2c_nb); +i2c_unregister_device (ov05c10->i2c_dev); +software_node_unregister_node_group (ov05c10_nodes); +} + +static struct platform_driver amd_isp_platform_driver = { + .driver = { + .name =AMD_ISP_PLAT_DRV_NAME , + .acpi_match_table = amdisp_sensor_ids, + }, + .probe = amd_isp_probe, + .remove = amd_isp_remove, +}; + +module_platform_driver (amd_isp_platform_driver); + +MODULE_AUTHOR ("Benjamin Chan <[email protected]>" ); +MODULE_AUTHOR ("Pratap Nirujogi <[email protected]>" ); +MODULE_DESCRIPTION ("AMD ISP4 Platform Driver" ); +MODULE_LICENSE ("GPL" );
Hi Pratap,
Quoted 64 lines · Pratap Nirujogi
ISP device specific configuration is not available in ACPI. Add swnode graph to configure the missing device properties for the OV05C10 camera device supported on amdisp platform.
Add support to create i2c-client dynamically when amdisp i2c adapter is available.
Co-developed-by Benjamin Chan <[email protected]>Signed-off-by Benjamin Chan <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Reviewed-by Hans de Goede <[email protected]>Reviewed-by Armin Wolf <[email protected]>Signed-off-by Pratap Nirujogi <[email protected]>---
Changes v11 -> v12:* Add missing space before the open parenthesis '('
drivers/platform/x86/amd/Kconfig | 11 ++ drivers/platform/x86/amd/Makefile | 1 + drivers/platform/x86/amd/amd_isp4.c | 280 ++++++++++++++++++++++++++++ 3 files changed, 292 insertions(+) create mode 100644 drivers/platform/x86/amd/amd_isp4.cdrivers/platform/x86/amd/Kconfig +11
-0@@ -32,3 +32,14 @@ config AMD_WBRF This mechanism will only be activated on platforms that advertise a need for it. + +config AMD_ISP_PLATFORM + tristate "AMD ISP4 platform driver" + depends on I2C && X86_64 && ACPI + help + Platform driver for AMD platforms containing image signal processor + gen 4. Provides camera sensor module board information to allow + sensor and V4L drivers to work properly. + + This driver can also be built as a module. If so, the module + will be called amd_isp4.drivers/platform/x86/amd/Makefile +1
-0@@ -10,3 +10,4 @@ obj-$(CONFIG_AMD_PMC) += pmc/ obj-$(CONFIG_AMD_HSMP) += hsmp/ obj-$(CONFIG_AMD_PMF) += pmf/ obj-$(CONFIG_AMD_WBRF) += wbrf.o +obj-$(CONFIG_AMD_ISP_PLATFORM) += amd_isp4.odrivers/platform/x86/amd/amd_isp4.c new file +6
-0@@ -0,0 +1,280 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* AMD ISP platform driver for sensor i2-client instantiation +* +* Copyright 2025 Advanced Micro Devices, Inc. +*/
drivers/platform/x86/amd/amd_isp4.c line 16
Quoted 10 lines
drivers/platform/x86/amd/amd_isp4.c new file +10
-0+ +#include <linux/i2c.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/property.h> +#include <linux/units.h> + +#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10"
What's the purpose of this _HID and is it present on actual firmware implementation? There's no such ACPI vendor ID as "OMNI".
Quoted 37 lines
drivers/platform/x86/amd/amd_isp4.c new file +37
-0+#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4" + +/* +* AMD ISP platform definition to configure the device properties +* missing in the ACPI table. +*/ +struct amdisp_platform { +struct i2c_board_info board_info; +struct notifier_block i2c_nb; +struct i2c_client *i2c_dev; +struct mutex lock;/* protects i2c client creation */ +}; + +/* Top-level OV05C10 camera node property table */ +static const struct property_entry ov05c10_camera_props[] = { +PROPERTY_ENTRY_U32 ("clock-frequency" ,24 *HZ_PER_MHZ ), + { } +}; + +/* Root AMD ISP OV05C10 camera node definition */ +static const struct software_node camera_node = { + .name =AMDISP_OV05C10_HID , + .properties = ov05c10_camera_props, +}; + +/* +* AMD ISP OV05C10 Ports node definition. No properties defined for +* ports node for OV05C10. +*/ +static const struct software_node ports = { + .name ="ports" , + .parent = &camera_node, +}; + +/* +* AMD ISP OV05C10 Port node definition. No properties defined for
drivers/platform/x86/amd/amd_isp4.c line 63
Quoted 10 lines
drivers/platform/x86/amd/amd_isp4.c new file +10
-0+* port node for OV05C10. +*/ +static const struct software_node port_node = { + .name ="port@" , + .parent = &ports, +}; + +/* +* Remote endpoint AMD ISP node definition. No properties defined for +* remote endpoint node for OV05C10.
How will this scale? Can you use other sensors with this ISP? Although if you get little from firmware, there's not much you can do. That being said, switching to DisCo for Imaging could be an easier step in this case.
Quoted 43 lines
drivers/platform/x86/amd/amd_isp4.c new file +43
-0+*/ +static const struct software_node remote_ep_isp_node = { + .name =AMDISP_OV05C10_REMOTE_EP_NAME , +}; + +/* +* Remote endpoint reference for isp node included in the +* OV05C10 endpoint. +*/ +static const struct software_node_ref_args ov05c10_refs[] = { +SOFTWARE_NODE_REFERENCE (&remote_ep_isp_node), +}; + +/* OV05C supports one single link frequency */ +static const u64 ov05c10_link_freqs[] = { +925 *HZ_PER_MHZ , +}; + +/* OV05C supports only 2-lane configuration */ +static const u32 ov05c10_data_lanes[] = { +1 , +2 , +}; + +/* OV05C10 endpoint node properties table */ +static const struct property_entry ov05c10_endpoint_props[] = { +PROPERTY_ENTRY_U32 ("bus-type" ,4 ), +PROPERTY_ENTRY_U32_ARRAY_LEN ("data-lanes" , ov05c10_data_lanes, +ARRAY_SIZE (ov05c10_data_lanes)), +PROPERTY_ENTRY_U64_ARRAY_LEN ("link-frequencies" , ov05c10_link_freqs, +ARRAY_SIZE (ov05c10_link_freqs)), +PROPERTY_ENTRY_REF_ARRAY ("remote-endpoint" , ov05c10_refs), + { } +}; + +/* AMD ISP endpoint node definition */ +static const struct software_node endpoint_node = { + .name ="endpoint" , + .parent = &port_node, + .properties = ov05c10_endpoint_props, +}; + +/*
drivers/platform/x86/amd/amd_isp4.c line 116
Quoted 10 lines
drivers/platform/x86/amd/amd_isp4.c new file +10
-0+* AMD ISP swnode graph uses 5 nodes and also its relationship is +* fixed to align with the structure that v4l2 expects for successful +* endpoint fwnode parsing. +* +* It is only the node property_entries that will vary for each platform +* supporting different sensor modules. +*/ +#define NUM_SW_NODES 5 + +static const struct software_node *ov05c10_nodes[NUM_SW_NODES +1 ] = {
Defining the number of entries seems to be redundant here.
Quoted 164 lines
drivers/platform/x86/amd/amd_isp4.c new file +164
-0+ &camera_node, + &ports, + &port_node, + &endpoint_node, + &remote_ep_isp_node, +NULL +}; + +static const struct acpi_device_id amdisp_sensor_ids[] = { + {AMDISP_OV05C10_HID }, + { } +}; +MODULE_DEVICE_TABLE (acpi, amdisp_sensor_ids); + +static inline bool is_isp_i2c_adapter (struct i2c_adapter *adap) +{ +return !strcmp (adap->owner->name,"i2c_designware_amdisp" ); +} + +static void instantiate_isp_i2c_client (struct amdisp_platform *ov05c10,struct i2c_adapter *adap) +{ +struct i2c_board_info *info = &ov05c10->board_info; +struct i2c_client *i2c_dev; + +guard (mutex)(&ov05c10->lock); + +if (ov05c10->i2c_dev) +return ; + + i2c_dev =i2c_new_client_device (adap, info); +if (IS_ERR (i2c_dev)) { +dev_err (&adap->dev,"error %pe registering isp i2c_client\n" , i2c_dev); +return ; + } + ov05c10->i2c_dev = i2c_dev; +} + +static int isp_i2c_bus_notify (struct notifier_block *nb, +unsigned long action,void *data) +{ + struct amdisp_platform *ov05c10 = container_of(nb, struct amdisp_platform, i2c_nb); +struct device *dev = data; +struct i2c_client *client; +struct i2c_adapter *adap; + +switch (action) { +case BUS_NOTIFY_ADD_DEVICE : + adap =i2c_verify_adapter (dev); +if (!adap) +break ; +if (is_isp_i2c_adapter (adap)) +instantiate_isp_i2c_client (ov05c10, adap); +break ; +case BUS_NOTIFY_REMOVED_DEVICE : + client =i2c_verify_client (dev); +if (!client) +break ; + + scoped_guard(mutex, &ov05c10->lock) { +if (ov05c10->i2c_dev == client) { +dev_dbg (&client->adapter->dev,"amdisp i2c_client removed\n" ); + ov05c10->i2c_dev =NULL ; + } + } +break ; +default : +break ; + } + +return NOTIFY_DONE ; +} + +static struct amdisp_platform *prepare_amdisp_platform (struct device *dev) +{ +struct amdisp_platform *isp_ov05c10; +int ret; + + isp_ov05c10 =devm_kzalloc (dev,sizeof (*isp_ov05c10),GFP_KERNEL ); +if (!isp_ov05c10) +return ERR_PTR (-ENOMEM ); + + ret =devm_mutex_init (dev, &isp_ov05c10->lock); +if (ret) +return ERR_PTR (ret); + + isp_ov05c10->board_info.dev_name ="ov05c10" ; +strscpy (isp_ov05c10->board_info.type,"ov05c10" ,I2C_NAME_SIZE ); + isp_ov05c10->board_info.addr =AMDISP_OV05C10_I2C_ADDR ; + + ret =software_node_register_node_group (ov05c10_nodes); +if (ret) +return ERR_PTR (ret); + + isp_ov05c10->board_info.swnode = ov05c10_nodes[0 ]; + +return isp_ov05c10; +} + +static int try_to_instantiate_i2c_client (struct device *dev,void *data) +{ +struct amdisp_platform *ov05c10 = (struct amdisp_platform *)data; +struct i2c_adapter *adap =i2c_verify_adapter (dev); + +if (!ov05c10 || !adap) +return 0 ; +if (!adap->owner) +return 0 ; + +if (is_isp_i2c_adapter (adap)) +instantiate_isp_i2c_client (ov05c10, adap); + +return 0 ; +} + +static int amd_isp_probe (struct platform_device *pdev) +{ +struct amdisp_platform *ov05c10; +int ret; + + ov05c10 =prepare_amdisp_platform (&pdev->dev); +if (IS_ERR (ov05c10)) +return dev_err_probe (&pdev->dev,PTR_ERR (ov05c10), +"failed to prepare AMD ISP platform fwnode\n" ); + + ov05c10->i2c_nb.notifier_call = isp_i2c_bus_notify; + ret =bus_register_notifier (&i2c_bus_type, &ov05c10->i2c_nb); +if (ret) + goto error_unregister_sw_node; + +/* check if adapter is already registered and create i2c client instance */ +i2c_for_each_dev ((void *)ov05c10, try_to_instantiate_i2c_client); + +platform_set_drvdata (pdev, ov05c10); +return 0 ; + +error_unregister_sw_node: +software_node_unregister_node_group (ov05c10_nodes); +return ret; +} + +static void amd_isp_remove (struct platform_device *pdev) +{ +struct amdisp_platform *ov05c10 =platform_get_drvdata (pdev); + +bus_unregister_notifier (&i2c_bus_type, &ov05c10->i2c_nb); +i2c_unregister_device (ov05c10->i2c_dev); +software_node_unregister_node_group (ov05c10_nodes); +} + +static struct platform_driver amd_isp_platform_driver = { + .driver = { + .name =AMD_ISP_PLAT_DRV_NAME , + .acpi_match_table = amdisp_sensor_ids, + }, + .probe = amd_isp_probe, + .remove = amd_isp_remove, +}; + +module_platform_driver (amd_isp_platform_driver); + +MODULE_AUTHOR ("Benjamin Chan <[email protected]>" ); +MODULE_AUTHOR ("Pratap Nirujogi <[email protected]>" ); +MODULE_DESCRIPTION ("AMD ISP4 Platform Driver" ); +MODULE_LICENSE ("GPL" );
Signature · 3 lines
Regards, Sakari Ailus
Hi Sakari,
Quoted 75 lines · Sakari Ailus
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Hi Pratap,
Quoted 69 lines · Pratap Nirujogi
ISP device specific configuration is not available in ACPI. Add swnode graph to configure the missing device properties for the OV05C10 camera device supported on amdisp platform.
Add support to create i2c-client dynamically when amdisp i2c adapter is available.
Co-developed-by Benjamin Chan <[email protected]>Signed-off-by Benjamin Chan <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Reviewed-by Hans de Goede <[email protected]>Reviewed-by Armin Wolf <[email protected]>Signed-off-by Pratap Nirujogi <[email protected]>---
Changes v11 -> v12:* Add missing space before the open parenthesis '('
drivers/platform/x86/amd/Kconfig | 11 ++ drivers/platform/x86/amd/Makefile | 1 + drivers/platform/x86/amd/amd_isp4.c | 280 ++++++++++++++++++++++++++++ 3 files changed, 292 insertions(+)create mode 100644
drivers/platform/x86/amd/amd_isp4.cdrivers/platform/x86/amd/Kconfig +11
-0@@ -32,3 +32,14 @@ config AMD_WBRF This mechanism will only be activated on platforms that advertise a need for it. + +config AMD_ISP_PLATFORM + tristate "AMD ISP4 platform driver" + depends on I2C && X86_64 && ACPI + help + Platform driver for AMD platforms containing image signal processor + gen 4. Provides camera sensor module board information to allow + sensor and V4L drivers to work properly. + + This driver can also be built as a module. If so, the module + will be called amd_isp4.drivers/platform/x86/amd/Makefile +1
-0@@ -10,3 +10,4 @@ obj-$(CONFIG_AMD_PMC) += pmc/ obj-$(CONFIG_AMD_HSMP) += hsmp/ obj-$(CONFIG_AMD_PMF) += pmf/ obj-$(CONFIG_AMD_WBRF) += wbrf.o +obj-$(CONFIG_AMD_ISP_PLATFORM) += amd_isp4.odrivers/platform/x86/amd/amd_isp4.c new file +11
-0@@ -0,0 +1,280 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* AMD ISP platform driver for sensor i2-client instantiation +* +* Copyright 2025 Advanced Micro Devices, Inc. +*/ + +#include <linux/i2c.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/property.h>
Quoted 9 lines
drivers/platform/x86/amd/amd_isp4.c line 16
Quoted 5 lines
drivers/platform/x86/amd/amd_isp4.c new file +5
-0+#include <linux/units.h> + +#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10"What's the purpose of this
_HIDand is it present on actual firmware implementation? There's no such ACPI vendor ID as "OMNI".
The (_HID, "OMNI5C10") is used to check if the OV05C10 ACPI device is actually present before creating the AMD ISP4 platform driver. Yes, ACPI entry is present for OV05C10 sensor in _SB/CAMF.
Scope (_SB)
{
Device (CAMF)
{
Name (_HID, "OMNI5C10") // _HID: Hardware ID
Name (_DDN, "OV05C-RGB") // _DDN: DOS Device Name
Name (_SUB, "OV05C") // _SUB: Subsystem IDQuoted 43 lines
Quoted 43 lines
drivers/platform/x86/amd/amd_isp4.c new file +43
-0+#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4" + +/* +* AMD ISP platform definition to configure the device properties +* missing in the ACPI table. +*/ +struct amdisp_platform { +struct i2c_board_info board_info; +struct notifier_block i2c_nb; +struct i2c_client *i2c_dev; +struct mutex lock;/* protects i2c client creation */ +}; + +/* Top-level OV05C10 camera node property table */ +static const struct property_entry ov05c10_camera_props[] = { +PROPERTY_ENTRY_U32 ("clock-frequency" ,24 *HZ_PER_MHZ ), + { } +}; + +/* Root AMD ISP OV05C10 camera node definition */ +static const struct software_node camera_node = { + .name =AMDISP_OV05C10_HID , + .properties = ov05c10_camera_props, +}; + +/* +* AMD ISP OV05C10 Ports node definition. No properties defined for +* ports node for OV05C10. +*/ +static const struct software_node ports = { + .name ="ports" , + .parent = &camera_node, +}; + +/* +* AMD ISP OV05C10 Port node definition. No properties defined for +* port node for OV05C10. +*/ +static const struct software_node port_node = { + .name ="port@" , + .parent = &ports, +};
Quoted 9 lines
drivers/platform/x86/amd/amd_isp4.c line 63
Quoted 4 lines
drivers/platform/x86/amd/amd_isp4.c new file +4
-0+ +/* +* Remote endpoint AMD ISP node definition. No properties defined for +* remote endpoint node for OV05C10. How will this scale? Can you use other sensors with this ISP? Although if you get little from firmware, there's not much you can do. That being said, switching to DisCo for Imaging could be an easier step in this case.
the scope of this driver is limited to ov05c10, and it can be enhanced to support other sensor modules in future.
Sorry, I'm not familiar with the term DisCo. Could you please elaborate.
Quoted 47 lines
Quoted 47 lines
drivers/platform/x86/amd/amd_isp4.c new file +47
-0+*/ +static const struct software_node remote_ep_isp_node = { + .name =AMDISP_OV05C10_REMOTE_EP_NAME , +}; + +/* +* Remote endpoint reference for isp node included in the +* OV05C10 endpoint. +*/ +static const struct software_node_ref_args ov05c10_refs[] = { +SOFTWARE_NODE_REFERENCE (&remote_ep_isp_node), +}; + +/* OV05C supports one single link frequency */ +static const u64 ov05c10_link_freqs[] = { +925 *HZ_PER_MHZ , +}; + +/* OV05C supports only 2-lane configuration */ +static const u32 ov05c10_data_lanes[] = { +1 , +2 , +}; + +/* OV05C10 endpoint node properties table */ +static const struct property_entry ov05c10_endpoint_props[] = { +PROPERTY_ENTRY_U32 ("bus-type" ,4 ), +PROPERTY_ENTRY_U32_ARRAY_LEN ("data-lanes" , ov05c10_data_lanes, +ARRAY_SIZE (ov05c10_data_lanes)), +PROPERTY_ENTRY_U64_ARRAY_LEN ("link-frequencies" , ov05c10_link_freqs, +ARRAY_SIZE (ov05c10_link_freqs)), +PROPERTY_ENTRY_REF_ARRAY ("remote-endpoint" , ov05c10_refs), + { } +}; + +/* AMD ISP endpoint node definition */ +static const struct software_node endpoint_node = { + .name ="endpoint" , + .parent = &port_node, + .properties = ov05c10_endpoint_props, +}; + +/* +* AMD ISP swnode graph uses 5 nodes and also its relationship is +* fixed to align with the structure that v4l2 expects for successful +* endpoint fwnode parsing. +*
Quoted 9 lines
drivers/platform/x86/amd/amd_isp4.c line 116
Quoted 6 lines
drivers/platform/x86/amd/amd_isp4.c new file +6
-0+* It is only the node property_entries that will vary for each platform +* supporting different sensor modules. +*/ +#define NUM_SW_NODES 5 + +static const struct software_node *ov05c10_nodes[NUM_SW_NODES +1 ] = {Defining the number of entries seems to be redundant here.
yes, NUM_SW_NODES can be removed, its no longer important. Will remove it in v13.
Thanks,
Pratap
Quoted 169 lines
Quoted 154 lines
drivers/platform/x86/amd/amd_isp4.c new file +154
-0+ &camera_node, + &ports, + &port_node, + &endpoint_node, + &remote_ep_isp_node, +NULL +}; + +static const struct acpi_device_id amdisp_sensor_ids[] = { + {AMDISP_OV05C10_HID }, + { } +}; +MODULE_DEVICE_TABLE (acpi, amdisp_sensor_ids); + +static inline bool is_isp_i2c_adapter (struct i2c_adapter *adap) +{ +return !strcmp (adap->owner->name,"i2c_designware_amdisp" ); +} + +static void instantiate_isp_i2c_client (struct amdisp_platform *ov05c10,struct i2c_adapter *adap) +{ +struct i2c_board_info *info = &ov05c10->board_info; +struct i2c_client *i2c_dev; + +guard (mutex)(&ov05c10->lock); + +if (ov05c10->i2c_dev) +return ; + + i2c_dev =i2c_new_client_device (adap, info); +if (IS_ERR (i2c_dev)) { +dev_err (&adap->dev,"error %pe registering isp i2c_client\n" , i2c_dev); +return ; + } + ov05c10->i2c_dev = i2c_dev; +} + +static int isp_i2c_bus_notify (struct notifier_block *nb, +unsigned long action,void *data) +{ + struct amdisp_platform *ov05c10 = container_of(nb, struct amdisp_platform, i2c_nb); +struct device *dev = data; +struct i2c_client *client; +struct i2c_adapter *adap; + +switch (action) { +case BUS_NOTIFY_ADD_DEVICE : + adap =i2c_verify_adapter (dev); +if (!adap) +break ; +if (is_isp_i2c_adapter (adap)) +instantiate_isp_i2c_client (ov05c10, adap); +break ; +case BUS_NOTIFY_REMOVED_DEVICE : + client =i2c_verify_client (dev); +if (!client) +break ; + + scoped_guard(mutex, &ov05c10->lock) { +if (ov05c10->i2c_dev == client) { +dev_dbg (&client->adapter->dev,"amdisp i2c_client removed\n" ); + ov05c10->i2c_dev =NULL ; + } + } +break ; +default : +break ; + } + +return NOTIFY_DONE ; +} + +static struct amdisp_platform *prepare_amdisp_platform (struct device *dev) +{ +struct amdisp_platform *isp_ov05c10; +int ret; + + isp_ov05c10 =devm_kzalloc (dev,sizeof (*isp_ov05c10),GFP_KERNEL ); +if (!isp_ov05c10) +return ERR_PTR (-ENOMEM ); + + ret =devm_mutex_init (dev, &isp_ov05c10->lock); +if (ret) +return ERR_PTR (ret); + + isp_ov05c10->board_info.dev_name ="ov05c10" ; +strscpy (isp_ov05c10->board_info.type,"ov05c10" ,I2C_NAME_SIZE ); + isp_ov05c10->board_info.addr =AMDISP_OV05C10_I2C_ADDR ; + + ret =software_node_register_node_group (ov05c10_nodes); +if (ret) +return ERR_PTR (ret); + + isp_ov05c10->board_info.swnode = ov05c10_nodes[0 ]; + +return isp_ov05c10; +} + +static int try_to_instantiate_i2c_client (struct device *dev,void *data) +{ +struct amdisp_platform *ov05c10 = (struct amdisp_platform *)data; +struct i2c_adapter *adap =i2c_verify_adapter (dev); + +if (!ov05c10 || !adap) +return 0 ; +if (!adap->owner) +return 0 ; + +if (is_isp_i2c_adapter (adap)) +instantiate_isp_i2c_client (ov05c10, adap); + +return 0 ; +} + +static int amd_isp_probe (struct platform_device *pdev) +{ +struct amdisp_platform *ov05c10; +int ret; + + ov05c10 =prepare_amdisp_platform (&pdev->dev); +if (IS_ERR (ov05c10)) +return dev_err_probe (&pdev->dev,PTR_ERR (ov05c10), +"failed to prepare AMD ISP platform fwnode\n" ); + + ov05c10->i2c_nb.notifier_call = isp_i2c_bus_notify; + ret =bus_register_notifier (&i2c_bus_type, &ov05c10->i2c_nb); +if (ret) + goto error_unregister_sw_node; + +/* check if adapter is already registered and create i2c client instance */ +i2c_for_each_dev ((void *)ov05c10, try_to_instantiate_i2c_client); + +platform_set_drvdata (pdev, ov05c10); +return 0 ; + +error_unregister_sw_node: +software_node_unregister_node_group (ov05c10_nodes); +return ret; +} + +static void amd_isp_remove (struct platform_device *pdev) +{ +struct amdisp_platform *ov05c10 =platform_get_drvdata (pdev); + +bus_unregister_notifier (&i2c_bus_type, &ov05c10->i2c_nb); +i2c_unregister_device (ov05c10->i2c_dev); +software_node_unregister_node_group (ov05c10_nodes); +} + +static struct platform_driver amd_isp_platform_driver = { + .driver = { + .name =AMD_ISP_PLAT_DRV_NAME , + .acpi_match_table = amdisp_sensor_ids, + },drivers/platform/x86/amd/amd_isp4.c line 280
Quoted 10 lines
drivers/platform/x86/amd/amd_isp4.c new file +10
-0+ .probe = amd_isp_probe, + .remove = amd_isp_remove, +}; + +module_platform_driver (amd_isp_platform_driver); + +MODULE_AUTHOR ("Benjamin Chan <[email protected]>" ); +MODULE_AUTHOR ("Pratap Nirujogi <[email protected]>" ); +MODULE_DESCRIPTION ("AMD ISP4 Platform Driver" ); +MODULE_LICENSE ("GPL" );--
Regards,Sakari Ailus
Hi Pratap,
Quoted 30 lines · Pratap
Quoted 17 lines
Quoted 17 lines
drivers/platform/x86/amd/amd_isp4.c new file +11
-0@@ -0,0 +1,280 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* AMD ISP platform driver for sensor i2-client instantiation +* +* Copyright 2025 Advanced Micro Devices, Inc. +*/ + +#include <linux/i2c.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/property.h> Quoted 9 lines
drivers/platform/x86/amd/amd_isp4.c line 16
Quoted 5 lines
drivers/platform/x86/amd/amd_isp4.c new file +5
-0+#include <linux/units.h> + +#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10"What's the purpose of this
_HIDand is it present on actual firmware implementation? There's no such ACPI vendor ID as "OMNI".The (
_HID, "OMNI5C10") is used to check if the OV05C10 ACPI device is actually present before creating the AMD ISP4 platform driver. Yes, ACPI entry is present for OV05C10 sensor in _SB/CAMF.
Quoted 5 lines
Scope (_SB)
{
Device (CAMF)
{
Name (_HID, "OMNI5C10") // _HID: Hardware IDPlease tell your BIOS folks this ACPI ID is invalid. In the future, either allocate one yourself with your own vendor ID or get one from the sensor vendor, which they would have allocated using their own ACPI vendor ID.
Quoted 56 lines
Name (_DDN, "OV05C-RGB") // _DDN: DOS Device Name Name (_SUB, "OV05C") // _SUB: Subsystem IDQuoted 43 lines
Quoted 43 lines
drivers/platform/x86/amd/amd_isp4.c new file +43
-0+#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4" + +/* +* AMD ISP platform definition to configure the device properties +* missing in the ACPI table. +*/ +struct amdisp_platform { +struct i2c_board_info board_info; +struct notifier_block i2c_nb; +struct i2c_client *i2c_dev; +struct mutex lock;/* protects i2c client creation */ +}; + +/* Top-level OV05C10 camera node property table */ +static const struct property_entry ov05c10_camera_props[] = { +PROPERTY_ENTRY_U32 ("clock-frequency" ,24 *HZ_PER_MHZ ), + { } +}; + +/* Root AMD ISP OV05C10 camera node definition */ +static const struct software_node camera_node = { + .name =AMDISP_OV05C10_HID , + .properties = ov05c10_camera_props, +}; + +/* +* AMD ISP OV05C10 Ports node definition. No properties defined for +* ports node for OV05C10. +*/ +static const struct software_node ports = { + .name ="ports" , + .parent = &camera_node, +}; + +/* +* AMD ISP OV05C10 Port node definition. No properties defined for +* port node for OV05C10. +*/ +static const struct software_node port_node = { + .name ="port@" , + .parent = &ports, +};Quoted 9 lines
drivers/platform/x86/amd/amd_isp4.c line 63
Quoted 4 lines
drivers/platform/x86/amd/amd_isp4.c new file +4
-0+ +/* +* Remote endpoint AMD ISP node definition. No properties defined for +* remote endpoint node for OV05C10. How will this scale? Can you use other sensors with this ISP? Although if you get little from firmware, there's not much you can do. That being said, switching to DisCo for Imaging could be an easier step in this case.
Quoted 4 lines
the scope of this driver is limited to ov05c10, and it can be enhanced to support other sensor modules in future.
Sorry, I'm not familiar with the term DisCo. Could you please elaborate.
See my reply to Hans.
Signature · 3 lines
Regards, Sakari Ailus
Hi Sakari,
Quoted 42 lines · Sakari Ailus
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Hi Pratap,
Quoted 30 lines · Pratap
Quoted 17 lines
Quoted 17 lines
drivers/platform/x86/amd/amd_isp4.c new file +11
-0@@ -0,0 +1,280 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* AMD ISP platform driver for sensor i2-client instantiation +* +* Copyright 2025 Advanced Micro Devices, Inc. +*/ + +#include <linux/i2c.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/property.h> Quoted 9 lines
drivers/platform/x86/amd/amd_isp4.c line 16
Quoted 5 lines
drivers/platform/x86/amd/amd_isp4.c new file +5
-0+#include <linux/units.h> + +#define AMDISP_OV05C10_I2C_ADDR 0x10 +#define AMDISP_OV05C10_PLAT_NAME "amdisp_ov05c10_platform" +#define AMDISP_OV05C10_HID "OMNI5C10"What's the purpose of this
_HIDand is it present on actual firmware implementation? There's no such ACPI vendor ID as "OMNI".The (
_HID, "OMNI5C10") is used to check if the OV05C10 ACPI device is actually present before creating the AMD ISP4 platform driver. Yes, ACPI entry is present for OV05C10 sensor in _SB/CAMF.Quoted 5 lines
Scope (_SB) { Device (CAMF) { Name (_HID, "OMNI5C10") // _HID: Hardware ID
Quoted 4 lines
Please tell your BIOS folks this ACPI ID is invalid. In the future, either allocate one yourself with your own vendor ID or get one from the sensor vendor, which they would have allocated using their own ACPI vendor ID.
Thanks for the feedback. I will share it with the BIOS team and make sure its taken into account for future models.
Thanks,
Pratap
Quoted 67 lines
Quoted 56 lines
Name (_DDN, "OV05C-RGB") // _DDN: DOS Device Name Name (_SUB, "OV05C") // _SUB: Subsystem IDQuoted 43 lines
Quoted 43 lines
drivers/platform/x86/amd/amd_isp4.c new file +43
-0+#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1" +#define AMD_ISP_PLAT_DRV_NAME "amd-isp4" + +/* +* AMD ISP platform definition to configure the device properties +* missing in the ACPI table. +*/ +struct amdisp_platform { +struct i2c_board_info board_info; +struct notifier_block i2c_nb; +struct i2c_client *i2c_dev; +struct mutex lock;/* protects i2c client creation */ +}; + +/* Top-level OV05C10 camera node property table */ +static const struct property_entry ov05c10_camera_props[] = { +PROPERTY_ENTRY_U32 ("clock-frequency" ,24 *HZ_PER_MHZ ), + { } +}; + +/* Root AMD ISP OV05C10 camera node definition */ +static const struct software_node camera_node = { + .name =AMDISP_OV05C10_HID , + .properties = ov05c10_camera_props, +}; + +/* +* AMD ISP OV05C10 Ports node definition. No properties defined for +* ports node for OV05C10. +*/ +static const struct software_node ports = { + .name ="ports" , + .parent = &camera_node, +}; + +/* +* AMD ISP OV05C10 Port node definition. No properties defined for +* port node for OV05C10. +*/ +static const struct software_node port_node = { + .name ="port@" , + .parent = &ports, +};Quoted 9 lines
drivers/platform/x86/amd/amd_isp4.c line 63
Quoted 4 lines
drivers/platform/x86/amd/amd_isp4.c new file +4
-0+ +/* +* Remote endpoint AMD ISP node definition. No properties defined for +* remote endpoint node for OV05C10. How will this scale? Can you use other sensors with this ISP? Although if you get little from firmware, there's not much you can do. That being said, switching to DisCo for Imaging could be an easier step in this case.
Quoted 4 lines
the scope of this driver is limited to ov05c10, and it can be enhanced to support other sensor modules in future.
Sorry, I'm not familiar with the term DisCo. Could you please elaborate.
See my reply to Hans.
--
Regards,Sakari Ailus
Hi Sakari,
Quoted 17 lines · Sakari Ailus
Hi Pratap,
Quoted 14 lines · Pratap Nirujogi
ISP device specific configuration is not available in ACPI. Add swnode graph to configure the missing device properties for the OV05C10 camera device supported on amdisp platform.
Add support to create i2c-client dynamically when amdisp i2c adapter is available.
Co-developed-by Benjamin Chan <[email protected]>Signed-off-by Benjamin Chan <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Reviewed-by Hans de Goede <[email protected]>Reviewed-by Armin Wolf <[email protected]>Signed-off-by Pratap Nirujogi <[email protected]>---
<snip>
Quoted 7 lines
Quoted 3 lines
+/*
+ * Remote endpoint AMD ISP node definition. No properties defined for
+ * remote endpoint node for OV05C10.How will this scale? Can you use other sensors with this ISP? Although if you get little from firmware, there's not much you can do. That being said, switching to DisCo for Imaging could be an easier step in this case.
Note I've already talked to AMD about the way the camera setup is currently being described in ACPI tables is suboptimal and how they really should use proper ACPI description using e.g. a _CRS with an I2cSerialBus resource for the sensor.
Although I must admit I did not bring up the ACPI DisCo for imaging spec as something to also look at for future generations.
Note that there currently is hw shipping using the somewhat broken ACPI sensor description this glue driver binds to, so we're stuck with dealing with these ACPI tables as they are already out there in the wild.
But yes for future hw generations it would be good to have a better description of the hw in ACPI.
Regards,
Hans
Hi Hans,
Quoted 27 lines · Hans de Goede
Hi Sakari,
Quoted 17 lines · Sakari Ailus
Hi Pratap,
Quoted 14 lines · Pratap Nirujogi
ISP device specific configuration is not available in ACPI. Add swnode graph to configure the missing device properties for the OV05C10 camera device supported on amdisp platform.
Add support to create i2c-client dynamically when amdisp i2c adapter is available.
Co-developed-by Benjamin Chan <[email protected]>Signed-off-by Benjamin Chan <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Reviewed-by Hans de Goede <[email protected]>Reviewed-by Armin Wolf <[email protected]>Signed-off-by Pratap Nirujogi <[email protected]>---
<snip>
Quoted 4 lines
Quoted 3 lines
+/*
+ * Remote endpoint AMD ISP node definition. No properties defined for
+ * remote endpoint node for OV05C10.
Quoted 8 lines
Quoted 3 lines
How will this scale? Can you use other sensors with this ISP? Although if you get little from firmware, there's not much you can do. That being said, switching to DisCo for Imaging could be an easier step in this case.
Note I've already talked to AMD about the way the camera setup is currently being described in ACPI tables is suboptimal and how they really should use proper ACPI description using e.g. a
_CRSwith an I2cSerialBus resource for the sensor.
That's one thing, yes, but it's not enough to get rid of the board code.
Quoted 3 lines
Although I must admit I did not bring up the ACPI DisCo for imaging spec as something to also look at for future generations.
I think we should really try to get rid of the board code the raw cameras on ACPI systems currently depend on, in future systems, instead of just reducing it a little bit. MIPI DisCo for Imaging enables that.
I guess you're not very familiar with Intel-based ChromeOS systems in this area? Maybe largely because they work out of the box. And there's no board code for these systems in the kernel. These are based (albeit I'm not quite sure about the latest ones) on older Linux-based definitions whereas newer MIPI DisCo for Imaging spec is OS-independent.
Quoted 5 lines
Note that there currently is hw shipping using the somewhat broken ACPI sensor description this glue driver binds to, so we're stuck with dealing with these ACPI tables as they are already out there in the wild.
I agree, there's little that can be done at this point.
Quoted 3 lines
But yes for future hw generations it would be good to have a better description of the hw in ACPI.
Signature · 3 lines
Regards, Sakari Ailus
Quoted 59 lines · Sakari Ailus
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Hi Hans,
Quoted 27 lines · Hans de Goede
Hi Sakari,
Quoted 17 lines · Sakari Ailus
Hi Pratap,
Quoted 14 lines · Pratap Nirujogi
ISP device specific configuration is not available in ACPI. Add swnode graph to configure the missing device properties for the OV05C10 camera device supported on amdisp platform.
Add support to create i2c-client dynamically when amdisp i2c adapter is available.
Co-developed-by Benjamin Chan <[email protected]>Signed-off-by Benjamin Chan <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Reviewed-by Hans de Goede <[email protected]>Reviewed-by Armin Wolf <[email protected]>Signed-off-by Pratap Nirujogi <[email protected]>---
<snip>
Quoted 4 lines
Quoted 3 lines
+/*
+ * Remote endpoint AMD ISP node definition. No properties defined for
+ * remote endpoint node for OV05C10.Quoted 8 lines
Quoted 3 lines
How will this scale? Can you use other sensors with this ISP? Although if you get little from firmware, there's not much you can do. That being said, switching to DisCo for Imaging could be an easier step in this case.
Note I've already talked to AMD about the way the camera setup is currently being described in ACPI tables is suboptimal and how they really should use proper ACPI description using e.g. a
_CRSwith an I2cSerialBus resource for the sensor.That's one thing, yes, but it's not enough to get rid of the board code.
Quoted 3 lines
Although I must admit I did not bring up the ACPI DisCo for imaging spec as something to also look at for future generations.
I think we should really try to get rid of the board code the raw cameras on ACPI systems currently depend on, in future systems, instead of just reducing it a little bit. MIPI DisCo for Imaging enables that.
I guess you're not very familiar with Intel-based ChromeOS systems in this area? Maybe largely because they work out of the box. And there's no board code for these systems in the kernel. These are based (albeit I'm not quite sure about the latest ones) on older Linux-based definitions whereas newer MIPI DisCo for Imaging spec is OS-independent.
Quoted 1 line
Quoted 11 lines
Quoted 4 lines
Note that there currently is hw shipping using the somewhat broken ACPI sensor description this glue driver binds to, so we're stuck with dealing with these ACPI tables as they are already out there in the wild.
I agree, there's little that can be done at this point.
Quoted 3 lines
But yes for future hw generations it would be good to have a better description of the hw in ACPI.
Hi Sakari, Hans,
Thanks for your support and understanding. We will work internally and ensure our future models adheres to MIPI DisCo Imaging spec.
Thanks,
Pratap
Quoted 4 lines
--
Regards,Sakari Ailus