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


Groups > linux.kernel > #1276900 > unrolled thread

Re: [PATCH 5/9] rtc-pcf2123: put the chip reset into a function

Started byAlexandre Belloni <alexandre.belloni@free-electrons.com>
First post2015-11-25 00:20 +0100
Last post2015-11-25 00:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 5/9] rtc-pcf2123: put the chip reset into a function Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-11-25 00:20 +0100

#1276900 — Re: [PATCH 5/9] rtc-pcf2123: put the chip reset into a function

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2015-11-25 00:20 +0100
SubjectRe: [PATCH 5/9] rtc-pcf2123: put the chip reset into a function
Message-ID<qyv2p-6iN-7@gated-at.bofh.it>
On 04/11/2015 at 07:36:36 -0800, Joshua Clayton wrote :

A commit message, even when simple is mandatory.

> Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
> ---
>  drivers/rtc/rtc-pcf2123.c | 64 ++++++++++++++++++++++++++---------------------
>  1 file changed, 36 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c
> index 257ce7d..d3c1447 100644
> --- a/drivers/rtc/rtc-pcf2123.c
> +++ b/drivers/rtc/rtc-pcf2123.c
> @@ -260,6 +260,40 @@ static int pcf2123_rtc_set_time(struct device *dev, struct rtc_time *tm)
>  	return 0;
>  }
>  
> +static int pcf2123_reset(struct device *dev)
> +{
> +	int ret;
> +	u8  rxbuf[2];
> +
> +	ret = pcf2123_write_reg(dev, PCF2123_REG_CTRL1, CTRL1_SW_RESET);
> +	if (ret < 0)
> +		return ret;
> +
> +	/* Stop the counter */
> +	dev_dbg(dev, "stopping RTC\n");
> +	ret = pcf2123_write_reg(dev, PCF2123_REG_CTRL1, CTRL1_STOP);
> +	if (ret < 0)
> +		return ret;
> +
> +	/* See if the counter was actually stopped */
> +	dev_dbg(dev, "checking for presence of RTC\n");
> +	ret = pcf2123_read(dev, PCF2123_REG_CTRL1, rxbuf, sizeof(rxbuf));
> +	if (ret < 0)
> +		return ret;
> +
> +	dev_dbg(dev, "received data from RTC (0x%02X 0x%02X)\n",
> +			rxbuf[0], rxbuf[1]);

This is not properly aligned (use checkpatch --strict)


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web