Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1601276

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

From Lee Jones <lee.jones@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 4/5] mfd: rk808: Add RK805 support
Date 2017-03-15 12:10 +0100
Message-ID <tleYy-6NF-7@gated-at.bofh.it> (permalink)
References <tji0x-51M-7@gated-at.bofh.it> <tji0x-51M-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@rock-chips.com>
> ---
>  drivers/clk/Kconfig |   4 +-

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

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

Comments below.

>  drivers/rtc/Kconfig |   4 +-

Acked-by: Lee Jones <lee.jones@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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v2 4/5] mfd: rk808: Add RK805 support Lee Jones <lee.jones@linaro.org> - 2017-03-15 12:10 +0100

csiph-web