All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: cw00.choi@samsung.com, Abhilash Kesavan <a.kesavan@samsung.com>
Cc: linux-iio@vger.kernel.org,
	Naveen Krishna <naveenkrishna.ch@gmail.com>,
	Abhilash Kesavan <kesavan.abhilash@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] iio: adc: exynos_adc: Add support for exynos7
Date: Wed, 05 Nov 2014 15:37:45 +0000	[thread overview]
Message-ID: <545A4449.8020906@kernel.org> (raw)
In-Reply-To: <CAGTfZH09UB7ipvZ+R_eKta-_rD-ggR9NaFMW6tds0E+yR_=yYA@mail.gmail.com>

On 01/11/14 08:25, Chanwoo Choi wrote:
> Hi Abhilash,
> 
> On Sat, Nov 1, 2014 at 1:00 PM, Abhilash Kesavan <a.kesavan@samsung.com> wrote:
>> The ADC on exynos7 is quite similar to ADCv2. The differences are as
>> follows:
>>         - exynos7-adc has 8 input channels (as against 10 in ADCv2).
>>         - exynos7 does not include an ADC PHY control register.
>>         - Some ADC_CON2 register bits being used in ADCv2 are listed as
>>           reserved in exynos7-adc. This results in a different init_hw
>>           function for exynos7.
>>
>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>

Looks good.

Applied to the togreg branch of iio.git, initially pushed out as testing for the
autobuilders to play.

Jonathan
>> ---
>> - Based on Naveen's "iio: exynos-adc: use syscon instead of ioremap" patchset
>> http://comments.gmane.org/gmane.linux.kernel.iio/13943
>>
>>  .../devicetree/bindings/arm/samsung/exynos-adc.txt |  2 ++
>>  drivers/iio/adc/exynos_adc.c                       | 32 ++++++++++++++++++++++
>>  2 files changed, 34 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
>> index c368210..f46ca9a 100644
>> --- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
>> +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
>> @@ -16,6 +16,8 @@ Required properties:
>>                                 future controllers.
>>                         Must be "samsung,exynos3250-adc" for
>>                                 controllers compatible with ADC of Exynos3250.
>> +                       Must be "samsung,exynos7-adc" for
>> +                               the ADC in Exynos7 and compatibles
>>                         Must be "samsung,s3c2410-adc" for
>>                                 the ADC in s3c2410 and compatibles
>>                         Must be "samsung,s3c2416-adc" for
>> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
>> index fe03177..3a2dbb3 100644
>> --- a/drivers/iio/adc/exynos_adc.c
>> +++ b/drivers/iio/adc/exynos_adc.c
>> @@ -390,6 +390,35 @@ static const struct exynos_adc_data exynos3250_adc_data = {
>>         .start_conv     = exynos_adc_v2_start_conv,
>>  };
>>
>> +static void exynos_adc_exynos7_init_hw(struct exynos_adc *info)
>> +{
>> +       u32 con1, con2;
>> +
>> +       if (info->data->needs_adc_phy)
>> +               regmap_write(info->pmu_map, info->data->phy_offset, 1);
>> +
>> +       con1 = ADC_V2_CON1_SOFT_RESET;
>> +       writel(con1, ADC_V2_CON1(info->regs));
>> +
>> +       con2 = readl(ADC_V2_CON2(info->regs));
>> +       con2 &= ~ADC_V2_CON2_C_TIME(7);
>> +       con2 |= ADC_V2_CON2_C_TIME(0);
>> +       writel(con2, ADC_V2_CON2(info->regs));
>> +
>> +       /* Enable interrupts */
>> +       writel(1, ADC_V2_INT_EN(info->regs));
>> +}
>> +
>> +static const struct exynos_adc_data exynos7_adc_data = {
>> +       .num_channels   = MAX_ADC_V1_CHANNELS,
>> +       .mask           = ADC_DATX_MASK, /* 12 bit ADC resolution */
>> +
>> +       .init_hw        = exynos_adc_exynos7_init_hw,
>> +       .exit_hw        = exynos_adc_v2_exit_hw,
>> +       .clear_irq      = exynos_adc_v2_clear_irq,
>> +       .start_conv     = exynos_adc_v2_start_conv,
>> +};
>> +
>>  static const struct of_device_id exynos_adc_match[] = {
>>         {
>>                 .compatible = "samsung,s3c2410-adc",
>> @@ -415,6 +444,9 @@ static const struct of_device_id exynos_adc_match[] = {
>>         }, {
>>                 .compatible = "samsung,exynos3250-adc",
>>                 .data = &exynos3250_adc_data,
>> +       }, {
>> +               .compatible = "samsung,exynos7-adc",
>> +               .data = &exynos7_adc_data,
>>         },
>>         {},
>>  };
> 
> Looks good to me.
> 
> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
> 
> Best Regards,
> Chanwoo Choi
> 

      reply	other threads:[~2014-11-05 15:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 12:38 [PATCH] iio: adc: exynos_adc: Add support for ADCv3 on exynos7 Abhilash Kesavan
2014-10-31 12:47 ` Chanwoo Choi
2014-10-31 14:01   ` Abhilash Kesavan
2014-10-31 16:14     ` Chanwoo Choi
2014-11-01  4:00       ` Abhilash Kesavan
2014-11-01  6:27         ` Chanwoo Choi
2014-11-01  7:34           ` Abhilash Kesavan
2014-11-01  4:00 ` [PATCH v2] iio: adc: exynos_adc: Add support for exynos7 Abhilash Kesavan
2014-11-01  8:25   ` Chanwoo Choi
2014-11-05 15:37     ` Jonathan Cameron [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=545A4449.8020906@kernel.org \
    --to=jic23@kernel.org \
    --cc=a.kesavan@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=kesavan.abhilash@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naveenkrishna.ch@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.