diff --git a/Makefile b/Makefile index ac0466c26459..96b1b8ddf59e 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ export CONFIG_VIDEO_AR0234 = m # kernel version >= 6.12.15 export CONFIG_VIDEO_ISX031=m export CONFIG_VIDEO_MAX9X=m +export CONFIG_VIDEO_AR0820=m obj-y += drivers/media/i2c/ @@ -75,6 +76,9 @@ subdir-ccflags-$(CONFIG_INTEL_SKL_INT3472) += \ subdir-ccflags-$(CONFIG_VIDEO_ISX031) += \ -DCONFIG_VIDEO_ISX031 +subdir-ccflags-$(CONFIG_VIDEO_AR0820) += \ + -DCONFIG_VIDEO_AR0820 + subdir-ccflags-y += $(subdir-ccflags-m) all: diff --git a/drivers/media/i2c/max9x/serdes.c b/drivers/media/i2c/max9x/serdes.c index bc41b77e2637..7e100c0effd6 100644 --- a/drivers/media/i2c/max9x/serdes.c +++ b/drivers/media/i2c/max9x/serdes.c @@ -1824,13 +1824,16 @@ static int max9x_registered(struct v4l2_subdev *sd) .table = { GPIO_LOOKUP("", 0, "reset", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("", 7, "fsin", + GPIO_ACTIVE_LOW), {} }, }; sensor_gpios.dev_id = dev_id; sensor_gpios.table[0].key = common->gpio_chip.label; - + sensor_gpios.table[1].key = common->gpio_chip.label; + gpiod_add_lookup_table(&sensor_gpios); struct v4l2_subdev *subdev = diff --git a/drivers/media/platform/intel/ipu-acpi-pdata.c b/drivers/media/platform/intel/ipu-acpi-pdata.c index 8488693f0068..e7bbefdf8c10 100644 --- a/drivers/media/platform/intel/ipu-acpi-pdata.c +++ b/drivers/media/platform/intel/ipu-acpi-pdata.c @@ -638,7 +638,7 @@ static int set_serdes_subdev(struct ipu_isys_subdev_info **serdes_sd, snprintf(serdes_sdinfo[i].suffix, sizeof(serdes_sdinfo[i].suffix), "%c-%d", SUFFIX_BASE + i, port); #if IS_ENABLED(CONFIG_VIDEO_ISX031) - serdes_sdinfo[i].ser_phys_addr = 0x40; + serdes_sdinfo[i].ser_phys_addr = 0x62; serdes_sdinfo[i].sensor_dt = 0x1e; #endif } diff --git a/drivers/media/platform/intel/ipu-acpi.c b/drivers/media/platform/intel/ipu-acpi.c index 8b94dc307735..ccb331852c38 100644 --- a/drivers/media/platform/intel/ipu-acpi.c +++ b/drivers/media/platform/intel/ipu-acpi.c @@ -63,6 +63,10 @@ static const struct ipu_acpi_devices supported_devices[] = { { "INTC031M", ISX031_NAME, get_sensor_pdata, NULL, 0, TYPE_SERDES, "max9x", ISX031_I2C_ADDRESS, 1600 }, // D3 ISX031 HID #endif +#if IS_ENABLED(CONFIG_VIDEO_AR0820) + { "AR0820", AR0820_NAME, get_sensor_pdata, NULL, 0, TYPE_SERDES, "max9x", + AR0820_I2C_ADDRESS, 1600 }, // SENSING AR0820 HID +#endif #endif }; @@ -88,6 +92,9 @@ static const struct acpi_device_id ipu_acpi_match[] = { #if IS_ENABLED(CONFIG_VIDEO_ISX031) { "INTC1031", 0 }, // ISX031 HID { "INTC031M", 0 }, // D3CMC68N-115-084 ISX031 HID +#endif +#if IS_ENABLED(CONFIG_VIDEO_AR0820) + { "AR0820", 0 }, // AR0820 HID #endif {}, }; diff --git a/include/media/i2c/ar0820.h b/include/media/i2c/ar0820.h new file mode 100644 index 000000000000..b1e5949cd040 --- /dev/null +++ b/include/media/i2c/ar0820.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (C) 2014 - 2022 Intel Corporation */ + +#ifndef __AR0820_H +#define __AR0820_H + +#include + +#define AR0820_NAME "ar0820" + +#define AR0820_I2C_ADDRESS 0x6D // Sensing ISP I2C Address is 0xDA >> 1 + +struct ar0820_platform_data { + unsigned int port; + unsigned int lanes; + uint32_t i2c_slave_address; + int irq_pin; + unsigned int irq_pin_flags; + char irq_pin_name[16]; + char suffix; + int gpios[4]; +}; + +#endif /* __AR0820_H */ diff --git a/include/media/serdes-pdata.h b/include/media/serdes-pdata.h index 829f730140b1..63acfbe210d6 100644 --- a/include/media/serdes-pdata.h +++ b/include/media/serdes-pdata.h @@ -8,6 +8,10 @@ #include #endif +#if IS_ENABLED(CONFIG_VIDEO_AR0820) +#include +#endif + struct serdes_subdev_info { struct i2c_board_info board_info; int i2c_adapter_id;