Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH AUTOSEL 4.19 066/167] iio: adc: exynos-adc: Add S5PV210 variant
       [not found] <20190903162519.7136-1-sashal@kernel.org>
@ 2019-09-03 16:23 ` Sasha Levin
  2019-09-03 17:53   ` Jonathan Cameron
  2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 067/167] dt-bindings: " Sasha Levin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Sasha Levin @ 2019-09-03 16:23 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jonathan Bakker, Paweł Chmiel, Jonathan Cameron,
	Sasha Levin, linux-iio

From: Jonathan Bakker <xc-racer2@live.ca>

[ Upstream commit 882bf52fdeab47dbe991cc0e564b0b51c571d0a3 ]

S5PV210's ADC variant is almost the same as v1 except that it has 10
channels and doesn't require the pmu register

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iio/adc/exynos_adc.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index 4be29ed447559..41da522fc6735 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -115,6 +115,7 @@
 #define MAX_ADC_V2_CHANNELS		10
 #define MAX_ADC_V1_CHANNELS		8
 #define MAX_EXYNOS3250_ADC_CHANNELS	2
+#define MAX_S5PV210_ADC_CHANNELS	10
 
 /* Bit definitions common for ADC_V1 and ADC_V2 */
 #define ADC_CON_EN_START	(1u << 0)
@@ -282,6 +283,16 @@ static const struct exynos_adc_data exynos_adc_v1_data = {
 	.start_conv	= exynos_adc_v1_start_conv,
 };
 
+static const struct exynos_adc_data exynos_adc_s5pv210_data = {
+	.num_channels	= MAX_S5PV210_ADC_CHANNELS,
+	.mask		= ADC_DATX_MASK,	/* 12 bit ADC resolution */
+
+	.init_hw	= exynos_adc_v1_init_hw,
+	.exit_hw	= exynos_adc_v1_exit_hw,
+	.clear_irq	= exynos_adc_v1_clear_irq,
+	.start_conv	= exynos_adc_v1_start_conv,
+};
+
 static void exynos_adc_s3c2416_start_conv(struct exynos_adc *info,
 					  unsigned long addr)
 {
@@ -478,6 +489,9 @@ static const struct of_device_id exynos_adc_match[] = {
 	}, {
 		.compatible = "samsung,s3c6410-adc",
 		.data = &exynos_adc_s3c64xx_data,
+	}, {
+		.compatible = "samsung,s5pv210-adc",
+		.data = &exynos_adc_s5pv210_data,
 	}, {
 		.compatible = "samsung,exynos-adc-v1",
 		.data = &exynos_adc_v1_data,
-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH AUTOSEL 4.19 067/167] dt-bindings: iio: adc: exynos-adc: Add S5PV210 variant
       [not found] <20190903162519.7136-1-sashal@kernel.org>
  2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 066/167] iio: adc: exynos-adc: Add S5PV210 variant Sasha Levin
@ 2019-09-03 16:23 ` " Sasha Levin
  2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 068/167] iio: adc: exynos-adc: Use proper number of channels for Exynos4x12 Sasha Levin
  2019-09-03 16:25 ` [PATCH AUTOSEL 4.19 155/167] iio: adc: gyroadc: fix uninitialized return code Sasha Levin
  3 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2019-09-03 16:23 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jonathan Bakker, Paweł Chmiel, Jonathan Cameron,
	Sasha Levin, linux-iio, devicetree

From: Jonathan Bakker <xc-racer2@live.ca>

[ Upstream commit a9b0a2a7c19316588421b94946c8e2e5a84ac14e ]

Add information about new compatible for S5PV210

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../devicetree/bindings/iio/adc/samsung,exynos-adc.txt        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt b/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt
index 6c49db7f8ad25..a10c1f89037de 100644
--- a/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt
@@ -11,7 +11,7 @@ New driver handles the following
 
 Required properties:
 - compatible:		Must be "samsung,exynos-adc-v1"
-				for exynos4412/5250 and s5pv210 controllers.
+				for exynos4412/5250 controllers.
 			Must be "samsung,exynos-adc-v2" for
 				future controllers.
 			Must be "samsung,exynos3250-adc" for
@@ -28,6 +28,8 @@ Required properties:
 				the ADC in s3c2443 and compatibles
 			Must be "samsung,s3c6410-adc" for
 				the ADC in s3c6410 and compatibles
+			Must be "samsung,s5pv210-adc" for
+				the ADC in s5pv210 and compatibles
 - reg:			List of ADC register address range
 			- The base address and range of ADC register
 			- The base address and range of ADC_PHY register (every
-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH AUTOSEL 4.19 068/167] iio: adc: exynos-adc: Use proper number of channels for Exynos4x12
       [not found] <20190903162519.7136-1-sashal@kernel.org>
  2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 066/167] iio: adc: exynos-adc: Add S5PV210 variant Sasha Levin
  2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 067/167] dt-bindings: " Sasha Levin
@ 2019-09-03 16:23 ` Sasha Levin
  2019-09-03 16:25 ` [PATCH AUTOSEL 4.19 155/167] iio: adc: gyroadc: fix uninitialized return code Sasha Levin
  3 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2019-09-03 16:23 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Krzysztof Kozlowski, Stable, Jonathan Cameron, Sasha Levin,
	linux-iio, devicetree

From: Krzysztof Kozlowski <krzk@kernel.org>

[ Upstream commit 103cda6a3b8d2c10d5f8cd7abad118e9db8f4776 ]

Exynos4212 and Exynos4412 have only four ADC channels so using
"samsung,exynos-adc-v1" compatible (for eight channels ADCv1) on them is
wrong.  Add a new compatible for Exynos4x12.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../bindings/iio/adc/samsung,exynos-adc.txt     |  4 +++-
 drivers/iio/adc/exynos_adc.c                    | 17 +++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt b/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt
index a10c1f89037de..e1fe02f3e3e9c 100644
--- a/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt
@@ -11,11 +11,13 @@ New driver handles the following
 
 Required properties:
 - compatible:		Must be "samsung,exynos-adc-v1"
-				for exynos4412/5250 controllers.
+				for Exynos5250 controllers.
 			Must be "samsung,exynos-adc-v2" for
 				future controllers.
 			Must be "samsung,exynos3250-adc" for
 				controllers compatible with ADC of Exynos3250.
+			Must be "samsung,exynos4212-adc" for
+				controllers compatible with ADC of Exynos4212 and Exynos4412.
 			Must be "samsung,exynos7-adc" for
 				the ADC in Exynos7 and compatibles
 			Must be "samsung,s3c2410-adc" for
diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index 41da522fc6735..1ca2c4d39f878 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -115,6 +115,7 @@
 #define MAX_ADC_V2_CHANNELS		10
 #define MAX_ADC_V1_CHANNELS		8
 #define MAX_EXYNOS3250_ADC_CHANNELS	2
+#define MAX_EXYNOS4212_ADC_CHANNELS	4
 #define MAX_S5PV210_ADC_CHANNELS	10
 
 /* Bit definitions common for ADC_V1 and ADC_V2 */
@@ -271,6 +272,19 @@ static void exynos_adc_v1_start_conv(struct exynos_adc *info,
 	writel(con1 | ADC_CON_EN_START, ADC_V1_CON(info->regs));
 }
 
+/* Exynos4212 and 4412 is like ADCv1 but with four channels only */
+static const struct exynos_adc_data exynos4212_adc_data = {
+	.num_channels	= MAX_EXYNOS4212_ADC_CHANNELS,
+	.mask		= ADC_DATX_MASK,	/* 12 bit ADC resolution */
+	.needs_adc_phy	= true,
+	.phy_offset	= EXYNOS_ADCV1_PHY_OFFSET,
+
+	.init_hw	= exynos_adc_v1_init_hw,
+	.exit_hw	= exynos_adc_v1_exit_hw,
+	.clear_irq	= exynos_adc_v1_clear_irq,
+	.start_conv	= exynos_adc_v1_start_conv,
+};
+
 static const struct exynos_adc_data exynos_adc_v1_data = {
 	.num_channels	= MAX_ADC_V1_CHANNELS,
 	.mask		= ADC_DATX_MASK,	/* 12 bit ADC resolution */
@@ -492,6 +506,9 @@ static const struct of_device_id exynos_adc_match[] = {
 	}, {
 		.compatible = "samsung,s5pv210-adc",
 		.data = &exynos_adc_s5pv210_data,
+	}, {
+		.compatible = "samsung,exynos4212-adc",
+		.data = &exynos4212_adc_data,
 	}, {
 		.compatible = "samsung,exynos-adc-v1",
 		.data = &exynos_adc_v1_data,
-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH AUTOSEL 4.19 155/167] iio: adc: gyroadc: fix uninitialized return code
       [not found] <20190903162519.7136-1-sashal@kernel.org>
                   ` (2 preceding siblings ...)
  2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 068/167] iio: adc: exynos-adc: Use proper number of channels for Exynos4x12 Sasha Levin
@ 2019-09-03 16:25 ` Sasha Levin
  3 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2019-09-03 16:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Arnd Bergmann, Wolfram Sang, Jonathan Cameron, Sasha Levin, linux-iio

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit 90c6260c1905a68fb596844087f2223bd4657fee ]

gcc-9 complains about a blatant uninitialized variable use that
all earlier compiler versions missed:

drivers/iio/adc/rcar-gyroadc.c:510:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

Return -EINVAL instead here and a few lines above it where
we accidentally return 0 on failure.

Cc: stable@vger.kernel.org
Fixes: 059c53b32329 ("iio: adc: Add Renesas GyroADC driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iio/adc/rcar-gyroadc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c
index dcb50172186f4..f3a966ab35dcb 100644
--- a/drivers/iio/adc/rcar-gyroadc.c
+++ b/drivers/iio/adc/rcar-gyroadc.c
@@ -391,7 +391,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
 				dev_err(dev,
 					"Only %i channels supported with %s, but reg = <%i>.\n",
 					num_channels, child->name, reg);
-				return ret;
+				return -EINVAL;
 			}
 		}
 
@@ -400,7 +400,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
 			dev_err(dev,
 				"Channel %i uses different ADC mode than the rest.\n",
 				reg);
-			return ret;
+			return -EINVAL;
 		}
 
 		/* Channel is valid, grab the regulator. */
-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH AUTOSEL 4.19 066/167] iio: adc: exynos-adc: Add S5PV210 variant
  2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 066/167] iio: adc: exynos-adc: Add S5PV210 variant Sasha Levin
@ 2019-09-03 17:53   ` Jonathan Cameron
  2019-09-03 19:46     ` Sasha Levin
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2019-09-03 17:53 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Jonathan Bakker, Paweł Chmiel,
	Jonathan Cameron, linux-iio

On Tue,  3 Sep 2019 12:23:38 -0400
Sasha Levin <sashal@kernel.org> wrote:

> From: Jonathan Bakker <xc-racer2@live.ca>
> 
> [ Upstream commit 882bf52fdeab47dbe991cc0e564b0b51c571d0a3 ]
> 
> S5PV210's ADC variant is almost the same as v1 except that it has 10
> channels and doesn't require the pmu register
> 
> Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
> Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Sasha Levin <sashal@kernel.org>

I have no particular objection to adding new IDs (which is more
or less what this patch is), but I didn't know autosel was
picking them up.  So a bit of surprise... If intentional
then fine to apply to stable.

> ---
>  drivers/iio/adc/exynos_adc.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index 4be29ed447559..41da522fc6735 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -115,6 +115,7 @@
>  #define MAX_ADC_V2_CHANNELS		10
>  #define MAX_ADC_V1_CHANNELS		8
>  #define MAX_EXYNOS3250_ADC_CHANNELS	2
> +#define MAX_S5PV210_ADC_CHANNELS	10
>  
>  /* Bit definitions common for ADC_V1 and ADC_V2 */
>  #define ADC_CON_EN_START	(1u << 0)
> @@ -282,6 +283,16 @@ static const struct exynos_adc_data exynos_adc_v1_data = {
>  	.start_conv	= exynos_adc_v1_start_conv,
>  };
>  
> +static const struct exynos_adc_data exynos_adc_s5pv210_data = {
> +	.num_channels	= MAX_S5PV210_ADC_CHANNELS,
> +	.mask		= ADC_DATX_MASK,	/* 12 bit ADC resolution */
> +
> +	.init_hw	= exynos_adc_v1_init_hw,
> +	.exit_hw	= exynos_adc_v1_exit_hw,
> +	.clear_irq	= exynos_adc_v1_clear_irq,
> +	.start_conv	= exynos_adc_v1_start_conv,
> +};
> +
>  static void exynos_adc_s3c2416_start_conv(struct exynos_adc *info,
>  					  unsigned long addr)
>  {
> @@ -478,6 +489,9 @@ static const struct of_device_id exynos_adc_match[] = {
>  	}, {
>  		.compatible = "samsung,s3c6410-adc",
>  		.data = &exynos_adc_s3c64xx_data,
> +	}, {
> +		.compatible = "samsung,s5pv210-adc",
> +		.data = &exynos_adc_s5pv210_data,
>  	}, {
>  		.compatible = "samsung,exynos-adc-v1",
>  		.data = &exynos_adc_v1_data,


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH AUTOSEL 4.19 066/167] iio: adc: exynos-adc: Add S5PV210 variant
  2019-09-03 17:53   ` Jonathan Cameron
@ 2019-09-03 19:46     ` Sasha Levin
  2019-09-07 11:09       ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: Sasha Levin @ 2019-09-03 19:46 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-kernel, stable, Jonathan Bakker, Paweł Chmiel,
	Jonathan Cameron, linux-iio

On Tue, Sep 03, 2019 at 06:53:28PM +0100, Jonathan Cameron wrote:
>On Tue,  3 Sep 2019 12:23:38 -0400
>Sasha Levin <sashal@kernel.org> wrote:
>
>> From: Jonathan Bakker <xc-racer2@live.ca>
>>
>> [ Upstream commit 882bf52fdeab47dbe991cc0e564b0b51c571d0a3 ]
>>
>> S5PV210's ADC variant is almost the same as v1 except that it has 10
>> channels and doesn't require the pmu register
>>
>> Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
>> Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
>> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>
>I have no particular objection to adding new IDs (which is more
>or less what this patch is), but I didn't know autosel was
>picking them up.  So a bit of surprise... If intentional
>then fine to apply to stable.

I dragged it in because 103cda6a3b8d2 ("iio: adc: exynos-adc: Use proper
number of channels for Exynos4x12") which is tagged for stable depended
on this patch, and given it just adds new IDs which is part of what we
take for stable I just took it in as is.

--
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH AUTOSEL 4.19 066/167] iio: adc: exynos-adc: Add S5PV210 variant
  2019-09-03 19:46     ` Sasha Levin
@ 2019-09-07 11:09       ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2019-09-07 11:09 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Jonathan Bakker, Paweł Chmiel,
	Jonathan Cameron, linux-iio

On Tue, 3 Sep 2019 15:46:54 -0400
Sasha Levin <sashal@kernel.org> wrote:

> On Tue, Sep 03, 2019 at 06:53:28PM +0100, Jonathan Cameron wrote:
> >On Tue,  3 Sep 2019 12:23:38 -0400
> >Sasha Levin <sashal@kernel.org> wrote:
> >  
> >> From: Jonathan Bakker <xc-racer2@live.ca>
> >>
> >> [ Upstream commit 882bf52fdeab47dbe991cc0e564b0b51c571d0a3 ]
> >>
> >> S5PV210's ADC variant is almost the same as v1 except that it has 10
> >> channels and doesn't require the pmu register
> >>
> >> Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
> >> Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
> >> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >> Signed-off-by: Sasha Levin <sashal@kernel.org>  
> >
> >I have no particular objection to adding new IDs (which is more
> >or less what this patch is), but I didn't know autosel was
> >picking them up.  So a bit of surprise... If intentional
> >then fine to apply to stable.  
> 
> I dragged it in because 103cda6a3b8d2 ("iio: adc: exynos-adc: Use proper
> number of channels for Exynos4x12") which is tagged for stable depended
> on this patch, and given it just adds new IDs which is part of what we
> take for stable I just took it in as is.
Ah fair enough!  Thanks for the explanation.

Jonathan

> 
> --
> Thanks,
> Sasha


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190903162519.7136-1-sashal@kernel.org>
2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 066/167] iio: adc: exynos-adc: Add S5PV210 variant Sasha Levin
2019-09-03 17:53   ` Jonathan Cameron
2019-09-03 19:46     ` Sasha Levin
2019-09-07 11:09       ` Jonathan Cameron
2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 067/167] dt-bindings: " Sasha Levin
2019-09-03 16:23 ` [PATCH AUTOSEL 4.19 068/167] iio: adc: exynos-adc: Use proper number of channels for Exynos4x12 Sasha Levin
2019-09-03 16:25 ` [PATCH AUTOSEL 4.19 155/167] iio: adc: gyroadc: fix uninitialized return code Sasha Levin

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org linux-iio@archiver.kernel.org
	public-inbox-index linux-iio


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/ public-inbox