Re: [PATCH] media: ipu3: add a module to probe sensors via ACPI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mauro,

Thanks for the patch.

On Sat, May 16, 2020 at 12:43:39PM +0200, Mauro Carvalho Chehab wrote:
> On devices without ACPI, or which ACPI is not prepared to
> export sensor data via DT, we need a different probing
> method.
> 
> This little driver adds initial support to probe the
> sensors found on a Dell Latitude 7285.
> 
> For now, it just detects the hardware and use request_module()
> to load a sensor driver.
> 
> In the specific case of this device, the ACPI DTST dable
> describes 2 camera sensors for this module, but the
> current upstream doesn't have yet drivers for such
> sensors. So, this patch just detects the PMIC used on
> this device and tries to load a sensor.
> 
> Once the sensor gets added, some additional code will
> be needed to pass via platform_data other details, like
> callbacks for PMIC's command to turn the sensor on/off
> and other sensor-specific settings.
> 
> The idea of this patch was inspired on how the sensors
> are probed by the staging atomisp driver.
> 
> The current result of this driver with the Dell
> Latitude 7285 is:
> 
> 	ipu3_acpi i2c-INT3477:00: ipu3_acpi_probe: ACPI detected it on bus ID=LNK1, HID=INT3477
> 	ipu3_acpi i2c-INT3477:00: Found DMI entry for 'Latitude 7285' with sensor INT3477
> 	ipu3_acpi i2c-INT3477:00: Loading sensor module ov8858
> 	ipu3_acpi i2c-OVTI9234:00: ipu3_acpi_probe: ACPI detected it on bus ID=LNK2, HID=OVTI9234
> 	ipu3_acpi i2c-OVTI9234:00: Found DMI entry for 'Latitude 7285' with sensor OVTI9234
> 	ipu3_acpi i2c-OVTI9234:00: Loading sensor module ov9234
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>

...

> +/*
> + * Should list known sensor devices found at DSDT table as "CAM0", "CAM1", ...
> + *
> + * The table below is probably incomplete. It came from the DSDT table found
> + * at a Dell Latitude 7285 (Method HCID).
> + */
> +static const struct acpi_device_id ipu3_acpi_acpi_match[] = {
> +	{"INT3471"},
> +	{"INT33BE"},
> +	{"INT3476"},
> +	{"INT3477"},
> +	{"INT3474"},
> +	{"INT3473"},
> +	{"INT3475"},
> +	{"INT3478"},
> +	{"INT3479"},
> +	{"INT347A"},
> +	{"INT347B"},
> +	{"OVTI9234"},
> +	{"OVTI9734"},
> +	{"OVTI8856"},
> +	{"OVTIF860"},
> +	{},
> +};
> +MODULE_DEVICE_TABLE(acpi, ipu3_acpi_acpi_match);

Instead of creating a new way to probe drivers on ACPI systems, please add
the appropriate ACPI device IDs to the respective drivers. E.g.
drivers/media/i2c/imx319.c implements this.

-- 
Kind regards,

Sakari Ailus
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux