From: Pratap Nirujogi <pratap.nirujogi@amd.com>
To: <mlimonci@amd.com>, <krzk@kernel.org>, <hdegoede@redhat.com>,
<ilpo.jarvinen@linux.intel.com>
Cc: <platform-driver-x86@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <benjamin.chan@amd.com>,
Pratap Nirujogi <pratap.nirujogi@amd.com>
Subject: [PATCH v1] platform/x86: amd: Add ISP platform info
Date: Mon, 3 Mar 2025 00:00:59 -0500 [thread overview]
Message-ID: <20250303050102.2298520-1-pratap.nirujogi@amd.com> (raw)
Add ov05c i2c boardinfo and GPIO pin info for AMD ISP platform.
Details of the resources added:
- Added i2c bus number for AMD ISP platform is 99.
- Added GPIO 85 to allow ISP driver to enable and disable ISP access.
- Added GPIO 0 to allow sensor driver to enable and disable sensor module.
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
---
drivers/platform/x86/amd/Kconfig | 11 ++++++
drivers/platform/x86/amd/Makefile | 1 +
drivers/platform/x86/amd/amd_isp.c | 63 ++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+)
create mode 100644 drivers/platform/x86/amd/amd_isp.c
diff --git a/drivers/platform/x86/amd/Kconfig b/drivers/platform/x86/amd/Kconfig
index c3e086ea64fc..0341270d70a6 100644
--- a/drivers/platform/x86/amd/Kconfig
+++ b/drivers/platform/x86/amd/Kconfig
@@ -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
+ bool "AMD platform with ISP4 that supports Camera sensor device"
+ depends on I2C && X86_64 && PINCTRL_AMDISP && AMD_ISP4
+ help
+ For AMD platform that support Image signal processor generation 4, it
+ is necessary to add platform specific camera sensor module board info
+ which includes the sensor driver device id and the i2c address.
+
+ If you have a AMD platform that support ISP4 and with a sensor
+ connected to it, say Y here
diff --git a/drivers/platform/x86/amd/Makefile b/drivers/platform/x86/amd/Makefile
index 56f62fc9c97b..0d89e2d4f7e6 100644
--- a/drivers/platform/x86/amd/Makefile
+++ b/drivers/platform/x86/amd/Makefile
@@ -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_isp.o
diff --git a/drivers/platform/x86/amd/amd_isp.c b/drivers/platform/x86/amd/amd_isp.c
new file mode 100644
index 000000000000..cb0faab4b9c3
--- /dev/null
+++ b/drivers/platform/x86/amd/amd_isp.c
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * AMD x86 platform driver for AMD HW platforms using ISP4
+ *
+ * Copyright 2025 Advanced Micro Devices, Inc.
+ */
+
+#include <linux/acpi.h>
+#include <linux/gpio/machine.h>
+#include <linux/init.h>
+#include <linux/i2c.h>
+#include <linux/kernel.h>
+
+#define AMDISP_I2C_BUS 99
+
+#define AMDISP_ACPI_CAM_HID "OMNI5C10"
+
+static struct gpiod_lookup_table isp_gpio_table = {
+ .dev_id = "amd_isp_capture",
+ .table = {
+ GPIO_LOOKUP("AMDI0030:00", 85, "enable_isp", GPIO_ACTIVE_HIGH),
+ { }
+ },
+};
+
+static struct gpiod_lookup_table isp_sensor_gpio_table = {
+ .dev_id = "ov05c",
+ .table = {
+ GPIO_LOOKUP("amdisp-pinctrl", 0, "sensor0_enable", GPIO_ACTIVE_HIGH),
+ { }
+ },
+};
+
+static struct i2c_board_info sensor_info = {
+ .dev_name = "ov05c",
+ I2C_BOARD_INFO("ov05c", 0x10),
+};
+
+static int __init amd_isp_init(void)
+{
+ int ret;
+
+ /* check for valid platform before configuring isp4 board resources */
+ if (!acpi_dev_found(AMDISP_ACPI_CAM_HID))
+ return -ENODEV;
+
+ gpiod_add_lookup_table(&isp_gpio_table);
+ gpiod_add_lookup_table(&isp_sensor_gpio_table);
+
+ ret = i2c_register_board_info(AMDISP_I2C_BUS, &sensor_info, 1);
+ if (ret)
+ pr_err("%s: cannot register i2c board devices:%s",
+ __func__, sensor_info.dev_name);
+
+ return ret;
+}
+
+module_init(amd_isp_init);
+
+MODULE_AUTHOR("Benjamin Chan <benjamin.chan@amd.com>");
+MODULE_AUTHOR("Pratap Nirujogi <pratap.nirujogi@amd.com>");
+MODULE_DESCRIPTION("AMD ISP4 Platform parameters");
+MODULE_LICENSE("GPL v2");
--
2.43.0
next reply other threads:[~2025-03-03 5:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 5:00 Pratap Nirujogi [this message]
2025-03-03 7:12 ` [PATCH v1] platform/x86: amd: Add ISP platform info Krzysztof Kozlowski
2025-03-03 17:04 ` Nirujogi, Pratap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250303050102.2298520-1-pratap.nirujogi@amd.com \
--to=pratap.nirujogi@amd.com \
--cc=benjamin.chan@amd.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlimonci@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox