linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] sony-cxd2880: add optional vcc regulator
@ 2018-11-08 12:50 Neil Armstrong
  2018-11-08 12:50 ` [PATCH 1/2] media: cxd2880-spi: Add " Neil Armstrong
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Neil Armstrong @ 2018-11-08 12:50 UTC (permalink / raw)
  To: Yasunari.Takiguchi; +Cc: Neil Armstrong, mchehab, linux-media, linux-kernel

This patchset adds an optional VCC regulator to the bindings and driver to
make sure power is enabled to the module before starting attaching to
the device.

Neil Armstrong (2):
  media: cxd2880-spi: Add optional vcc regulator
  media: sony-cxd2880: add optional vcc regulator to bindings

 .../devicetree/bindings/media/spi/sony-cxd2880.txt       |  4 ++++
 drivers/media/spi/cxd2880-spi.c                          | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)

-- 
2.7.4


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

* [PATCH 1/2] media: cxd2880-spi: Add optional vcc regulator
  2018-11-08 12:50 [PATCH 0/2] sony-cxd2880: add optional vcc regulator Neil Armstrong
@ 2018-11-08 12:50 ` Neil Armstrong
  2018-11-08 12:50 ` [PATCH 2/2] media: sony-cxd2880: add optional vcc regulator to bindings Neil Armstrong
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Neil Armstrong @ 2018-11-08 12:50 UTC (permalink / raw)
  To: Yasunari.Takiguchi; +Cc: Neil Armstrong, mchehab, linux-media, linux-kernel

This patchset adds an optional VCC regulator to the driver probe function to
make sure power is enabled to the module before starting attaching to
the device.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/media/spi/cxd2880-spi.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/media/spi/cxd2880-spi.c b/drivers/media/spi/cxd2880-spi.c
index c437309..d5c433e 100644
--- a/drivers/media/spi/cxd2880-spi.c
+++ b/drivers/media/spi/cxd2880-spi.c
@@ -10,6 +10,7 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
 
 #include <linux/spi/spi.h>
+#include <linux/regulator/consumer.h>
 #include <linux/ktime.h>
 
 #include <media/dvb_demux.h>
@@ -51,6 +52,7 @@ struct cxd2880_dvb_spi {
 	struct mutex spi_mutex; /* For SPI access exclusive control */
 	int feed_count;
 	int all_pid_feed_count;
+	struct regulator *vcc_supply;
 	u8 *ts_buf;
 	struct cxd2880_pid_filter_config filter_config;
 };
@@ -518,6 +520,17 @@ cxd2880_spi_probe(struct spi_device *spi)
 	if (!dvb_spi)
 		return -ENOMEM;
 
+	dvb_spi->vcc_supply = devm_regulator_get_optional(&spi->dev, "vcc");
+	if (IS_ERR(dvb_spi->vcc_supply)) {
+		if (PTR_ERR(dvb_spi->vcc_supply) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+		dvb_spi->vcc_supply = NULL;
+	} else {
+		ret = regulator_enable(dvb_spi->vcc_supply);
+		if (ret)
+			return ret;
+	}
+
 	dvb_spi->spi = spi;
 	mutex_init(&dvb_spi->spi_mutex);
 	dev_set_drvdata(&spi->dev, dvb_spi);
@@ -631,6 +644,9 @@ cxd2880_spi_remove(struct spi_device *spi)
 	dvb_frontend_detach(&dvb_spi->dvb_fe);
 	dvb_unregister_adapter(&dvb_spi->adapter);
 
+	if (dvb_spi->vcc_supply)
+		regulator_disable(dvb_spi->vcc_supply);
+
 	kfree(dvb_spi);
 	pr_info("cxd2880_spi remove ok.\n");
 
-- 
2.7.4


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

* [PATCH 2/2] media: sony-cxd2880: add optional vcc regulator to bindings
  2018-11-08 12:50 [PATCH 0/2] sony-cxd2880: add optional vcc regulator Neil Armstrong
  2018-11-08 12:50 ` [PATCH 1/2] media: cxd2880-spi: Add " Neil Armstrong
@ 2018-11-08 12:50 ` Neil Armstrong
  2018-11-17 16:17   ` Rob Herring
  2018-11-09  2:22 ` [PATCH 0/2] sony-cxd2880: add optional vcc regulator Frank Rowand
  2018-11-13  5:34 ` Yasunari.Takiguchi
  3 siblings, 1 reply; 7+ messages in thread
From: Neil Armstrong @ 2018-11-08 12:50 UTC (permalink / raw)
  To: Yasunari.Takiguchi, devicetree
  Cc: Neil Armstrong, mchehab, linux-media, linux-kernel

This patchset adds an optional VCC regulator to the bindings of the Sony
CXD2880 DVB-T2/T tuner + demodulator adapter.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 Documentation/devicetree/bindings/media/spi/sony-cxd2880.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/spi/sony-cxd2880.txt b/Documentation/devicetree/bindings/media/spi/sony-cxd2880.txt
index fc5aa26..98a72c0 100644
--- a/Documentation/devicetree/bindings/media/spi/sony-cxd2880.txt
+++ b/Documentation/devicetree/bindings/media/spi/sony-cxd2880.txt
@@ -5,6 +5,10 @@ Required properties:
 - reg: SPI chip select number for the device.
 - spi-max-frequency: Maximum bus speed, should be set to <55000000> (55MHz).
 
+Optional properties:
+- vcc-supply: Optional phandle to the vcc regulator to power the adapter,
+  as described in the file ../regulator/regulator.txt
+
 Example:
 
 cxd2880@0 {
-- 
2.7.4


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

* Re: [PATCH 0/2] sony-cxd2880: add optional vcc regulator
  2018-11-08 12:50 [PATCH 0/2] sony-cxd2880: add optional vcc regulator Neil Armstrong
  2018-11-08 12:50 ` [PATCH 1/2] media: cxd2880-spi: Add " Neil Armstrong
  2018-11-08 12:50 ` [PATCH 2/2] media: sony-cxd2880: add optional vcc regulator to bindings Neil Armstrong
@ 2018-11-09  2:22 ` Frank Rowand
  2018-11-09  8:50   ` Neil Armstrong
  2018-11-13  5:34 ` Yasunari.Takiguchi
  3 siblings, 1 reply; 7+ messages in thread
From: Frank Rowand @ 2018-11-09  2:22 UTC (permalink / raw)
  To: Neil Armstrong, Yasunari.Takiguchi; +Cc: mchehab, linux-media, linux-kernel

Hi Neil,

On 11/8/18 4:50 AM, Neil Armstrong wrote:
> This patchset adds an optional VCC regulator to the bindings and driver to
> make sure power is enabled to the module before starting attaching to
> the device.
> 
> Neil Armstrong (2):
>   media: cxd2880-spi: Add optional vcc regulator
>   media: sony-cxd2880: add optional vcc regulator to bindings
> 
>  .../devicetree/bindings/media/spi/sony-cxd2880.txt       |  4 ++++
>  drivers/media/spi/cxd2880-spi.c                          | 16 ++++++++++++++++
>  2 files changed, 20 insertions(+)
> 

Please see Documentation/devicetree/bindings/submitting-patches.txt
for some helpful information about submitting a series that includes
a bindings patch.

You will want to add 'dt-bindings:' into the subject line, along with the
current 'media:'.  And getmaintainer will give you Rob's and Mark's
emails.

Thanks,

Frank

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

* Re: [PATCH 0/2] sony-cxd2880: add optional vcc regulator
  2018-11-09  2:22 ` [PATCH 0/2] sony-cxd2880: add optional vcc regulator Frank Rowand
@ 2018-11-09  8:50   ` Neil Armstrong
  0 siblings, 0 replies; 7+ messages in thread
From: Neil Armstrong @ 2018-11-09  8:50 UTC (permalink / raw)
  To: Frank Rowand, Yasunari.Takiguchi; +Cc: mchehab, linux-media, linux-kernel

Hi Frank,

On 09/11/2018 03:22, Frank Rowand wrote:
> Hi Neil,
> 
> On 11/8/18 4:50 AM, Neil Armstrong wrote:
>> This patchset adds an optional VCC regulator to the bindings and driver to
>> make sure power is enabled to the module before starting attaching to
>> the device.
>>
>> Neil Armstrong (2):
>>   media: cxd2880-spi: Add optional vcc regulator
>>   media: sony-cxd2880: add optional vcc regulator to bindings
>>
>>  .../devicetree/bindings/media/spi/sony-cxd2880.txt       |  4 ++++
>>  drivers/media/spi/cxd2880-spi.c                          | 16 ++++++++++++++++
>>  2 files changed, 20 insertions(+)
>>
> 
> Please see Documentation/devicetree/bindings/submitting-patches.txt
> for some helpful information about submitting a series that includes
> a bindings patch.
> 
> You will want to add 'dt-bindings:' into the subject line, along with the
> current 'media:'.  And getmaintainer will give you Rob's and Mark's
> emails.

I'll re-spin with dt-bindings, but some maintainers don't want or don't care,
so it's always a wild guess at some point !

> 
> Thanks,
> 
> Frank
> 

Neil

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

* RE: [PATCH 0/2] sony-cxd2880: add optional vcc regulator
  2018-11-08 12:50 [PATCH 0/2] sony-cxd2880: add optional vcc regulator Neil Armstrong
                   ` (2 preceding siblings ...)
  2018-11-09  2:22 ` [PATCH 0/2] sony-cxd2880: add optional vcc regulator Frank Rowand
@ 2018-11-13  5:34 ` Yasunari.Takiguchi
  3 siblings, 0 replies; 7+ messages in thread
From: Yasunari.Takiguchi @ 2018-11-13  5:34 UTC (permalink / raw)
  To: narmstrong; +Cc: mchehab, linux-media, linux-kernel, Yasunari.Takiguchi

Hi Neil,

I am not familiar to this vcc function 
but I check this compile is ok.

Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com>

> -----Original Message-----
> From: Neil Armstrong [mailto:narmstrong@baylibre.com]
> Sent: Thursday, November 8, 2018 9:50 PM
> To: Takiguchi, Yasunari (SSS)
> Cc: Neil Armstrong; mchehab@kernel.org; linux-media@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [PATCH 0/2] sony-cxd2880: add optional vcc regulator
> 
> This patchset adds an optional VCC regulator to the bindings and driver
> to
> make sure power is enabled to the module before starting attaching to
> the device.
> 
> Neil Armstrong (2):
>   media: cxd2880-spi: Add optional vcc regulator
>   media: sony-cxd2880: add optional vcc regulator to bindings
> 
>  .../devicetree/bindings/media/spi/sony-cxd2880.txt       |  4 ++++
>  drivers/media/spi/cxd2880-spi.c                          | 16
> ++++++++++++++++
>  2 files changed, 20 insertions(+)
> 
> --
> 2.7.4


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

* Re: [PATCH 2/2] media: sony-cxd2880: add optional vcc regulator to bindings
  2018-11-08 12:50 ` [PATCH 2/2] media: sony-cxd2880: add optional vcc regulator to bindings Neil Armstrong
@ 2018-11-17 16:17   ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2018-11-17 16:17 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Yasunari.Takiguchi, devicetree, Neil Armstrong, mchehab,
	linux-media, linux-kernel

On Thu,  8 Nov 2018 13:50:10 +0100, Neil Armstrong wrote:
> This patchset adds an optional VCC regulator to the bindings of the Sony
> CXD2880 DVB-T2/T tuner + demodulator adapter.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  Documentation/devicetree/bindings/media/spi/sony-cxd2880.txt | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2018-11-17 16:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 12:50 [PATCH 0/2] sony-cxd2880: add optional vcc regulator Neil Armstrong
2018-11-08 12:50 ` [PATCH 1/2] media: cxd2880-spi: Add " Neil Armstrong
2018-11-08 12:50 ` [PATCH 2/2] media: sony-cxd2880: add optional vcc regulator to bindings Neil Armstrong
2018-11-17 16:17   ` Rob Herring
2018-11-09  2:22 ` [PATCH 0/2] sony-cxd2880: add optional vcc regulator Frank Rowand
2018-11-09  8:50   ` Neil Armstrong
2018-11-13  5:34 ` Yasunari.Takiguchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).