mbox series

[RFC,0/3] ACPI, PMICs and probing cameras

Message ID 20210819201936.7390-1-sakari.ailus@linux.intel.com
Headers show
Series ACPI, PMICs and probing cameras | expand

Message

Sakari Ailus Aug. 19, 2021, 8:19 p.m. UTC
Hi all,

The intel_skl_int3472 driver is required for some of the ACPI power state
transitions to function. This driver may be compiled as a module and thus
may probe after a sensor driver that depends on it (e.g. imx258).

Make the sensor driver return -EPROBE_DEFER if the sensor cannot be found.
This way the sensor driver will be probed when both the intel_skl_int3472
and the gpio-tps68470 drivers have successfully probed while also the
gpio-tps68470 driver may be built as a module.

The drawback of the approach is needless probing of the imx258 driver but
everything can be built as modules.

I'm posting this as RFC since the approach would require effectively all
ACPI based sensor drivers to have the same check. This would be a
non-issue to add. I wouldn't mind but...

Is there a way to figure out whether the PMIC opregion callbacks actually
succeed? At least the imx258 driver is happily probed even if the driver
implementing the opregion callback is not there, and thus the device
remains powered off --- and probe fails.

Sakari Ailus (3):
  imx258: Defer probing on ident register read fail (on ACPI)
  gpio-tps68470: Allow building as module
  gpio-tps68470: Add modalias

 drivers/gpio/Kconfig         | 2 +-
 drivers/gpio/gpio-tps68470.c | 5 ++++-
 drivers/media/i2c/imx258.c   | 8 ++++++++
 3 files changed, 13 insertions(+), 2 deletions(-)

Comments

Andy Shevchenko Aug. 20, 2021, 12:22 p.m. UTC | #1
On Thu, Aug 19, 2021 at 11:19:35PM +0300, Sakari Ailus wrote:
> Allow building gpio-tps68470 driver as a module. The intel_skl_int3472 is

> a module anyway, so making this a builtin does not really help setting up

> this one before a dependent module probes.


Fine with me,
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> ---

>  drivers/gpio/Kconfig         | 2 +-

>  drivers/gpio/gpio-tps68470.c | 4 +++-

>  2 files changed, 4 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig

> index fab571016adf..8911c2df97d1 100644

> --- a/drivers/gpio/Kconfig

> +++ b/drivers/gpio/Kconfig

> @@ -1378,7 +1378,7 @@ config GPIO_TPS65912

>  	  This driver supports TPS65912 gpio chip

>  

>  config GPIO_TPS68470

> -	bool "TPS68470 GPIO"

> +	tristate "TPS68470 GPIO"

>  	depends on INTEL_SKL_INT3472

>  	help

>  	  Select this option to enable GPIO driver for the TPS68470

> diff --git a/drivers/gpio/gpio-tps68470.c b/drivers/gpio/gpio-tps68470.c

> index 423b7bc30ae8..0ab88ef241de 100644

> --- a/drivers/gpio/gpio-tps68470.c

> +++ b/drivers/gpio/gpio-tps68470.c

> @@ -155,4 +155,6 @@ static struct platform_driver tps68470_gpio_driver = {

>  	.probe = tps68470_gpio_probe,

>  };

>  

> -builtin_platform_driver(tps68470_gpio_driver)

> +module_platform_driver(tps68470_gpio_driver);

> +

> +MODULE_LICENSE("GPL");

> -- 

> 2.30.2

> 


-- 
With Best Regards,
Andy Shevchenko