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


Groups > linux.kernel > #1504075 > unrolled thread

[PATCH v2 00/10] Revamp Semtech SX150x driver

Started byAndrey Smirnov <andrew.smirnov@gmail.com>
First post2016-10-19 18:20 +0200
Last post2016-10-21 11:20 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 00/10] Revamp Semtech SX150x driver Andrey Smirnov <andrew.smirnov@gmail.com> - 2016-10-19 18:20 +0200
    [PATCH v2 05/10] gpio-sx150x: Replace "io_pull*_ena" with DT bindings Andrey Smirnov <andrew.smirnov@gmail.com> - 2016-10-19 18:30 +0200
    Re: [PATCH v2 00/10] Revamp Semtech SX150x driver Linus Walleij <linus.walleij@linaro.org> - 2016-10-20 21:10 +0200
      Re: [PATCH v2 00/10] Revamp Semtech SX150x driver Andrey Smirnov <andrew.smirnov@gmail.com> - 2016-10-20 21:40 +0200
        Re: [PATCH v2 00/10] Revamp Semtech SX150x driver Neil Armstrong <narmstrong@baylibre.com> - 2016-10-21 11:20 +0200

#1504075 — [PATCH v2 00/10] Revamp Semtech SX150x driver

FromAndrey Smirnov <andrew.smirnov@gmail.com>
Date2016-10-19 18:20 +0200
Subject[PATCH v2 00/10] Revamp Semtech SX150x driver
Message-ID<stZSO-2nd-69@gated-at.bofh.it>
Hello everyone,

This is the second version of the patchset originally submitted here:

http://www.spinics.net/lists/devicetree/msg146176.html

The only change since v1 is that, per Rob Herring's recommendation, all
of the changes to bindings documentation were coalesced into a single patch.

Thank you,
Andrey Smirnov

Andrey Smirnov (10):
  gpio-sx150x: Remove 'gpio_base' from pdata
  gpio-sx150x: Remove 'irq_summary' parameter
  gpio-sx150x: Remove 'irq_base' parameter
  gpio-sx150x: Replace 'io_polarity' with DT binding
  gpio-sx150x: Replace "io_pull*_ena" with DT bindings
  gpio-sx150x: Replace 'reset_during_probe" with DT binding
  gpio-sx150x: Replace 'oscio_is_gpio' with DT binding
  gpio-sx150x: Remove struct sx150x_platform_data
  gpio-sx150x: Pass device type in DT match table
  bindings: gpio-sx150x: Document new bindings

 .../devicetree/bindings/gpio/gpio-sx150x.txt       |  29 ++++
 drivers/gpio/gpio-sx150x.c                         | 184 +++++++++------------
 2 files changed, 105 insertions(+), 108 deletions(-)

-- 
2.5.5

[toc] | [next] | [standalone]


#1504102 — [PATCH v2 05/10] gpio-sx150x: Replace "io_pull*_ena" with DT bindings

FromAndrey Smirnov <andrew.smirnov@gmail.com>
Date2016-10-19 18:30 +0200
Subject[PATCH v2 05/10] gpio-sx150x: Replace "io_pull*_ena" with DT bindings
Message-ID<su1UD-3KZ-63@gated-at.bofh.it>
In reply to#1504075
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/gpio/gpio-sx150x.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c
index 9b62133..b751ff9 100644
--- a/drivers/gpio/gpio-sx150x.c
+++ b/drivers/gpio/gpio-sx150x.c
@@ -90,24 +90,12 @@ struct sx150x_device_data {
  *                instead of as an oscillator, increasing the size of the
  *                GP(I)O pool created by this expander by one.  The
  *                output-only GPO pin will be added at the end of the block.
- * @io_pullup_ena: A bit-mask which enables or disables the pull-up resistor
- *                 for each IO line in the expander.  Setting the bit at
- *                 position n will enable the pull-up for the IO at
- *                 the corresponding offset.  For chips with fewer than
- *                 16 IO pins, high-end bits are ignored.
- * @io_pulldn_ena: A bit-mask which enables-or disables the pull-down
- *                 resistor for each IO line in the expander. Setting the
- *                 bit at position n will enable the pull-down for the IO at
- *                 the corresponding offset.  For chips with fewer than
- *                 16 IO pins, high-end bits are ignored.
  * @reset_during_probe: If set to true, the driver will trigger a full
  *                      reset of the chip at the beginning of the probe
  *                      in order to place it in a known state.
  */
 struct sx150x_platform_data {
 	bool     oscio_is_gpo;
-	u16      io_pullup_ena;
-	u16      io_pulldn_ena;
 	bool     reset_during_probe;
 };
 
@@ -614,6 +602,8 @@ static int sx150x_reset(struct sx150x_chip *chip)
 static int sx150x_init_hw(struct sx150x_chip *chip,
 			struct sx150x_platform_data *pdata)
 {
+	u32 io_pulldown = 0;
+	u32 io_pullup   = 0;
 	int err = 0;
 
 	if (pdata->reset_during_probe) {
@@ -622,6 +612,14 @@ static int sx150x_init_hw(struct sx150x_chip *chip,
 			return err;
 	}
 
+	of_property_read_u32(chip->client->dev.of_node,
+			     "semtech,io-pullup",
+			     &io_pullup);
+
+	of_property_read_u32(chip->client->dev.of_node,
+			     "semtech,io-pulldown",
+			     &io_pulldown);
+
 	if (chip->dev_cfg->model == SX150X_789)
 		err = sx150x_i2c_write(chip->client,
 				chip->dev_cfg->pri.x789.reg_misc,
@@ -638,12 +636,12 @@ static int sx150x_init_hw(struct sx150x_chip *chip,
 		return err;
 
 	err = sx150x_init_io(chip, chip->dev_cfg->reg_pullup,
-			pdata->io_pullup_ena);
+			     io_pullup);
 	if (err < 0)
 		return err;
 
 	err = sx150x_init_io(chip, chip->dev_cfg->reg_pulldn,
-			pdata->io_pulldn_ena);
+			     io_pulldown);
 	if (err < 0)
 		return err;
 
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1505193

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-10-20 21:10 +0200
Message-ID<suqT0-3fz-23@gated-at.bofh.it>
In reply to#1504075
On Wed, Oct 19, 2016 at 4:03 PM, Andrey Smirnov
<andrew.smirnov@gmail.com> wrote:

> Hello everyone,
>
> This is the second version of the patchset originally submitted here:
>
> http://www.spinics.net/lists/devicetree/msg146176.html

I'm sorry about your efforts, and sorry for not having had time to
comment earlier, but this driver will be removed and replaced by
a pin control driver by Neil Armstrong:
http://marc.info/?l=linux-gpio&m=147499137422454&w=2

As you can see it arrived some weeks before.

Can you please review Neils patch and make sure it satisfies
your usecases?

The reason we have to make a pin control driver are things you
can see by the quirky things for line driving or biasing etc
that you have to add if it stays in GPIO: pin control is made
to handle this kind of stuff in a generic way.

Yours,
Linus Walleij

[toc] | [prev] | [next] | [standalone]


#1505207

FromAndrey Smirnov <andrew.smirnov@gmail.com>
Date2016-10-20 21:40 +0200
Message-ID<surm1-3pA-1@gated-at.bofh.it>
In reply to#1505193
On Thu, Oct 20, 2016 at 12:08 PM, Linus Walleij
<linus.walleij@linaro.org> wrote:
> On Wed, Oct 19, 2016 at 4:03 PM, Andrey Smirnov
> <andrew.smirnov@gmail.com> wrote:
>
>> Hello everyone,
>>
>> This is the second version of the patchset originally submitted here:
>>
>> http://www.spinics.net/lists/devicetree/msg146176.html
>
> I'm sorry about your efforts, and sorry for not having had time to
> comment earlier, but this driver will be removed and replaced by
> a pin control driver by Neil Armstrong:
> http://marc.info/?l=linux-gpio&m=147499137422454&w=2
>
> As you can see it arrived some weeks before.
>
> Can you please review Neils patch and make sure it satisfies
> your usecases?

Sure, I'll grab those patches and provide comments, Tested-by's, etc.

Thanks,
Andrey Smirnov

[toc] | [prev] | [next] | [standalone]


#1505632

FromNeil Armstrong <narmstrong@baylibre.com>
Date2016-10-21 11:20 +0200
Message-ID<suE9B-3xe-75@gated-at.bofh.it>
In reply to#1505207
On 10/20/2016 09:34 PM, Andrey Smirnov wrote:
> On Thu, Oct 20, 2016 at 12:08 PM, Linus Walleij
> <linus.walleij@linaro.org> wrote:
>> On Wed, Oct 19, 2016 at 4:03 PM, Andrey Smirnov
>> <andrew.smirnov@gmail.com> wrote:
>>
>>> Hello everyone,
>>>
>>> This is the second version of the patchset originally submitted here:
>>>
>>> http://www.spinics.net/lists/devicetree/msg146176.html
>>
>> I'm sorry about your efforts, and sorry for not having had time to
>> comment earlier, but this driver will be removed and replaced by
>> a pin control driver by Neil Armstrong:
>> http://marc.info/?l=linux-gpio&m=147499137422454&w=2
>>
>> As you can see it arrived some weeks before.
>>
>> Can you please review Neils patch and make sure it satisfies
>> your usecases?
> 
> Sure, I'll grab those patches and provide comments, Tested-by's, etc.
> 
> Thanks,
> Andrey Smirnov
> 

Hi Andrey,

Please find the v3 patch at https://marc.info/?l=linux-gpio&m=147704101505236&w=2

Maybe it could better to actually add the 1503 support even if it's using the sx1506q_device_data.

Could you try out this driver and report a Tested-by if successful ?

Neil

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web