From: Tony Lindgren <tony@atomide.com>
To: Mikko Ylinen <mikko.k.ylinen@nokia.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH] CBUS: A workaround for ADC S/H HW bug: always keep ch 8 selected when S/H is used
Date: Thu, 3 Jul 2008 13:20:07 +0300 [thread overview]
Message-ID: <20080703102005.GG14276@atomide.com> (raw)
In-Reply-To: <1214832497-23911-1-git-send-email-mikko.k.ylinen@nokia.com>
* Mikko Ylinen <mikko.k.ylinen@nokia.com> [080630 16:34]:
Pushing today.
Tony
> Signed-off-by: Mikko Ylinen <mikko.k.ylinen@nokia.com>
> ---
> drivers/cbus/retu.c | 12 ++++++++++++
> drivers/cbus/retu.h | 1 +
> 2 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/cbus/retu.c b/drivers/cbus/retu.c
> index 715b88d..4849841 100644
> --- a/drivers/cbus/retu.c
> +++ b/drivers/cbus/retu.c
> @@ -114,9 +114,21 @@ int retu_read_adc(int channel)
> return -EINVAL;
>
> spin_lock_irqsave(&retu_lock, flags);
> +
> + if ((channel == 8) && retu_is_vilma) {
> + int scr = retu_read_reg(RETU_REG_ADCSCR);
> + int ch = (retu_read_reg(RETU_REG_ADCR) >> 10) & 0xf;
> + if (((scr & 0xff) != 0) && (ch != 8))
> + retu_write_reg (RETU_REG_ADCSCR, (scr & ~0xff));
> + }
> +
> /* Select the channel and read result */
> retu_write_reg(RETU_REG_ADCR, channel << 10);
> res = retu_read_reg(RETU_REG_ADCR) & 0x3ff;
> +
> + if (retu_is_vilma)
> + retu_write_reg(RETU_REG_ADCR, (1 << 13));
> +
> /* Unlock retu */
> spin_unlock_irqrestore(&retu_lock, flags);
>
> diff --git a/drivers/cbus/retu.h b/drivers/cbus/retu.h
> index 49f23e6..c9e044c 100644
> --- a/drivers/cbus/retu.h
> +++ b/drivers/cbus/retu.h
> @@ -34,6 +34,7 @@
> #define RETU_REG_RTCHMAR 0x05 /* RTC hours and minutes alarm and time set register */
> #define RETU_REG_RTCCALR 0x06 /* RTC calibration register */
> #define RETU_REG_ADCR 0x08 /* ADC result */
> +#define RETU_REG_ADCSCR 0x09 /* ADC sample ctrl */
> #define RETU_REG_CC1 0x0d /* Common control register 1 */
> #define RETU_REG_CC2 0x0e /* Common control register 2 */
> #define RETU_REG_CTRL_CLR 0x0f /* Regulator clear register */
> --
> 1.5.5.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2008-07-03 12:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-30 13:28 [PATCH] CBUS: A workaround for ADC S/H HW bug: always keep ch 8 selected when S/H is used Mikko Ylinen
2008-07-03 10:20 ` Tony Lindgren [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080703102005.GG14276@atomide.com \
--to=tony@atomide.com \
--cc=linux-omap@vger.kernel.org \
--cc=mikko.k.ylinen@nokia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox