[PATCH v2 4/5] mfd: rk808: Add RK805 support

Lee Jones lee.jones at linaro.org
Wed Mar 15 04:03:15 PDT 2017


On Fri, 10 Mar 2017, Elaine Zhang wrote:

> The RK805 chip is a Power Management IC (PMIC) for multimedia and handheld
> devices. It contains the following components:
> 
>     - Regulators
>     - RTC
>     - Clocking
> 
> Both RK808 and RK805 chips are using a similar register map,
> so we can reuse the RTC and Clocking functionality.
> 
> Signed-off-by: Elaine Zhang <zhangqing at rock-chips.com>
> ---
>  drivers/clk/Kconfig |   4 +-

Acked-by: Lee Jones <lee.jones at linaro.org>

>  drivers/mfd/Kconfig |   4 +-
>  drivers/mfd/rk808.c | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++

Comments below.

>  drivers/rtc/Kconfig |   4 +-

Acked-by: Lee Jones <lee.jones at linaro.org>

>  4 files changed, 123 insertions(+), 6 deletions(-)

Split this patch up into subsystems, it'll save issues.

[...]

> --- a/drivers/mfd/rk808.c
> +++ b/drivers/mfd/rk808.c

[...]

> +static void rk805_device_shutdown(void)
> +{
> +	int ret;
> +	struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
> +
> +	if (!rk808) {
> +		dev_warn(&rk808_i2c_client->dev,
> +			 "have no rk808, so do nothing here\n");
> +		return;
> +	}
> +
> +	/* close rtc int when power off */
> +	regmap_update_bits(rk808->regmap,
> +			   RK808_INT_STS_MSK_REG1,
> +			   (0x3 << 5), (0x3 << 5));

No magic numbers.  Please define these.

> +	regmap_update_bits(rk808->regmap,
> +			   RK808_RTC_INT_REG,
> +			   (0x3 << 2), (0x0 << 2));

No magic numbers.  Please define these.

> +
> +	/* pmic sleep shutdown function */
> +	ret = regmap_update_bits(rk808->regmap,
> +				 RK805_GPIO_IO_POL_REG,
> +				 SLP_SD_MSK, SHUTDOWN_FUN);
> +	if (ret)
> +		dev_err(&rk808_i2c_client->dev, "power off error!\n");
> +}

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog



More information about the Linux-rockchip mailing list