Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1650254 > unrolled thread
| Started by | Shawn Guo <shawnguo@kernel.org> |
|---|---|
| First post | 2017-05-25 09:30 +0200 |
| Last post | 2017-05-28 17:20 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device Shawn Guo <shawnguo@kernel.org> - 2017-05-25 09:30 +0200
Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2017-05-25 10:10 +0200
Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device Jonathan Cameron <jic23@kernel.org> - 2017-05-28 17:20 +0200
| From | Shawn Guo <shawnguo@kernel.org> |
|---|---|
| Date | 2017-05-25 09:30 +0200 |
| Subject | Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device |
| Message-ID | <tKVnA-5du-7@gated-at.bofh.it> |
On Tue, May 23, 2017 at 09:02:27AM +0300, Nikita Yushchenko wrote: > >> However, hi8435 driver historically was coded using inverted values > >> passed to gpiolib calls. And there are setups in the wild with device > >> trees containing GPIO_ACTIVE_HIGH that I'd prefer not breaking. > >> > >> To solve, I submitted a patch on hi8435 driver that changes to _raw() > >> gpio calls (thus making it independent of what is written in device > >> tree), and want [future] device trees not to contain explicitly written > >> gpio polarity. > > > > So maybe add another #define, GPIO_ACTIVE_IGNORED, to make it clear > > that it does not matter what value you put there, it is ignored. > > "Crap origin" here is that in vast majority of cases, polarity is > per-chip, not per-chip-use, knowledge. And proper location for per-chip > knowledge is chip's driver. Moving this knowledge to per-chip-use > location in device trees only provides a source for errors, with little > gain. > > Vladimir Barinov mentions possibility that signal can be inverted by > board between gpio provider and chip's pin ... but do we have at least > one practical case of this? And if we even do, it's quite uncommon, and > something special should be required in device tree for these special > cases and not for "normal" cases. I disagree. Not for hi8435, but I have seen quite some board designs invert GPIOs before getting them into board level components. That's why we should define those xxx-gpios properties on board level DTS, where polarity can be chosen per board design. Shawn
[toc] | [next] | [standalone]
| From | Nikita Yushchenko <nikita.yoush@cogentembedded.com> |
|---|---|
| Date | 2017-05-25 10:10 +0200 |
| Message-ID | <tKW0j-5FH-21@gated-at.bofh.it> |
| In reply to | #1650254 |
>> "Crap origin" here is that in vast majority of cases, polarity is >> per-chip, not per-chip-use, knowledge. And proper location for per-chip >> knowledge is chip's driver. Moving this knowledge to per-chip-use >> location in device trees only provides a source for errors, with little >> gain. >> >> Vladimir Barinov mentions possibility that signal can be inverted by >> board between gpio provider and chip's pin ... but do we have at least >> one practical case of this? And if we even do, it's quite uncommon, and >> something special should be required in device tree for these special >> cases and not for "normal" cases. > > I disagree. Not for hi8435, but I have seen quite some board designs > invert GPIOs before getting them into board level components. That's > why we should define those xxx-gpios properties on board level DTS, > where polarity can be chosen per board design. Even if such, still board specific knowledge is "is gpio as-is or inverted", but knowledge if chip expects signal to be active low or active high, remains chip-specific. I'm thinking of proposing new flags in gpio binding, say GPIO_NATIVE_POLARITY / GPIO_INVERTED_POLARITY, that could be used instead of GPIO_ACTIVE_HIGH / GPIO_ACTIVE_LOW, and leave knowledge about signal polarity to chip's driver, while still allow to describe inversion of needed. Nikita
[toc] | [prev] | [next] | [standalone]
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Date | 2017-05-28 17:20 +0200 |
| Message-ID | <tM893-3Fg-9@gated-at.bofh.it> |
| In reply to | #1650272 |
On Thu, 25 May 2017 11:03:20 +0300 Nikita Yushchenko <nikita.yoush@cogentembedded.com> wrote: > >> "Crap origin" here is that in vast majority of cases, polarity is > >> per-chip, not per-chip-use, knowledge. And proper location for per-chip > >> knowledge is chip's driver. Moving this knowledge to per-chip-use > >> location in device trees only provides a source for errors, with little > >> gain. > >> > >> Vladimir Barinov mentions possibility that signal can be inverted by > >> board between gpio provider and chip's pin ... but do we have at least > >> one practical case of this? And if we even do, it's quite uncommon, and > >> something special should be required in device tree for these special > >> cases and not for "normal" cases. > > > > I disagree. Not for hi8435, but I have seen quite some board designs > > invert GPIOs before getting them into board level components. That's > > why we should define those xxx-gpios properties on board level DTS, > > where polarity can be chosen per board design. > > Even if such, still board specific knowledge is "is gpio as-is or > inverted", but knowledge if chip expects signal to be active low or > active high, remains chip-specific. > > I'm thinking of proposing new flags in gpio binding, say > GPIO_NATIVE_POLARITY / GPIO_INVERTED_POLARITY, that could be used > instead of GPIO_ACTIVE_HIGH / GPIO_ACTIVE_LOW, and leave knowledge about > signal polarity to chip's driver, while still allow to describe > inversion of needed. Whilst I'm not certain on the precise approach (I'd be tempted by heavy handed explicit representation of the inverting component) it seems like this needs more thought. I'm going to revert my rather premature applying of the initial change for now. Jonathan > > Nikita
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web