Re: [PATCH 2/4] regulator: pfuze: add support to other architectures

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

 



Hi Michael,

On Mon, Jan 27, 2020 at 04:50:11PM +0100, Michael Grzeschik wrote:
> Currently the pfuze driver is build dependent to ARCH_IMX6. To make it
> possible to work with ARCH_IMX8 we move the imx6_poweroff call to an own
> poweroff handler.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
> ---
>  arch/arm/mach-imx/imx6.c  | 8 ++++++++
>  drivers/regulator/Kconfig | 2 +-
>  drivers/regulator/pfuze.c | 2 --
>  3 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/imx6.c b/arch/arm/mach-imx/imx6.c
> index 41e0066add..8f1638c1ea 100644
> --- a/arch/arm/mach-imx/imx6.c
> +++ b/arch/arm/mach-imx/imx6.c
> @@ -401,3 +401,11 @@ void __noreturn imx6_pm_stby_poweroff(void)
>  
>  	while(1);
>  }
> +
> +static int imx6_init(void)
> +{
> +	poweroff_handler_register_fn(imx6_pm_stby_poweroff);
> +
> +	return 0;
> +}

imx6_pm_stby_poweroff() only works when a pfuze is present and is
configured correctly. Calling this on every i.MX board is not nice.

What you can do is to call pfuze_register_init_callback() from here.
You'll have to add a static inline wrapper for this in case pfuze
support is not compiled in.

I wonder how this compiles as my version of this file already has a
function named imx6_init(). Using this is preferred btw as it's already
made sure that it will run only on i.MX6.

> +coredevice_initcall(imx6_init);

Note that this doesn't necessarily means that we are running an i.MX6.
It could be whatever else is compiled in.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux