* [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver
@ 2025-01-10 13:00 Bartosz Golaszewski
2025-01-10 13:00 ` [PATCH 1/2] Revert "gpio: 74x164: Add On Semi MC74HC595A compat" Bartosz Golaszewski
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-01-10 13:00 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Ripard,
J . Neuschäfer, Csókás Bence,
Geert Uytterhoeven via gmail . com
Cc: linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
There were other suggested solutions (for instance: just use the
existing compatible for the On Semi variant) but I figured the most
common approach is to use a fallback value for 100% compatible models
and this is what Rob suggested as well.
This reverts the driver change and makes the "onnn,74hc595a" compatible
use "fairchild,74hc595" as fallback.
Bartosz Golaszewski (2):
Revert "gpio: 74x164: Add On Semi MC74HC595A compat"
dt-bindings: gpio: fairchild,74hc595: use a fallback for Semi
MC74HC595A
.../devicetree/bindings/gpio/fairchild,74hc595.yaml | 10 ++++++----
drivers/gpio/gpio-74x164.c | 2 --
2 files changed, 6 insertions(+), 6 deletions(-)
--
2.45.2
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 1/2] Revert "gpio: 74x164: Add On Semi MC74HC595A compat" 2025-01-10 13:00 [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver Bartosz Golaszewski @ 2025-01-10 13:00 ` Bartosz Golaszewski 2025-01-11 10:53 ` Krzysztof Kozlowski 2025-01-10 13:00 ` [PATCH 2/2] dt-bindings: gpio: fairchild,74hc595: use a fallback for Semi MC74HC595A Bartosz Golaszewski 2025-01-10 13:32 ` [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver Csókás Bence 2 siblings, 1 reply; 13+ messages in thread From: Bartosz Golaszewski @ 2025-01-10 13:00 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, Csókás Bence, Geert Uytterhoeven via gmail . com Cc: linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> This reverts commit b1468db9d865deb5271c9a20d05201b1c0636895. There's no need to add a new compatible to the driver code, we can handle it with a DT fallback. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> --- drivers/gpio/gpio-74x164.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c index 2ce00e90ea56..fca6cd2eb1dd 100644 --- a/drivers/gpio/gpio-74x164.c +++ b/drivers/gpio/gpio-74x164.c @@ -165,7 +165,6 @@ static void gen_74x164_remove(struct spi_device *spi) static const struct spi_device_id gen_74x164_spi_ids[] = { { .name = "74hc595" }, - { .name = "74hc595a" }, { .name = "74lvc594" }, {}, }; @@ -174,7 +173,6 @@ MODULE_DEVICE_TABLE(spi, gen_74x164_spi_ids); static const struct of_device_id gen_74x164_dt_ids[] = { { .compatible = "fairchild,74hc595" }, { .compatible = "nxp,74lvc594" }, - { .compatible = "onnn,74hc595a" }, {}, }; MODULE_DEVICE_TABLE(of, gen_74x164_dt_ids); -- 2.45.2 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Revert "gpio: 74x164: Add On Semi MC74HC595A compat" 2025-01-10 13:00 ` [PATCH 1/2] Revert "gpio: 74x164: Add On Semi MC74HC595A compat" Bartosz Golaszewski @ 2025-01-11 10:53 ` Krzysztof Kozlowski 0 siblings, 0 replies; 13+ messages in thread From: Krzysztof Kozlowski @ 2025-01-11 10:53 UTC (permalink / raw) To: Bartosz Golaszewski Cc: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, Csókás Bence, Geert Uytterhoeven via gmail . com, linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski On Fri, Jan 10, 2025 at 02:00:24PM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > This reverts commit b1468db9d865deb5271c9a20d05201b1c0636895. > > There's no need to add a new compatible to the driver code, we can > handle it with a DT fallback. > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > --- I assume this was not released anywhere, judging by dates, but would be nice to see confirmation in commit msg or changelog. > drivers/gpio/gpio-74x164.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c > index 2ce00e90ea56..fca6cd2eb1dd 100644 > --- a/drivers/gpio/gpio-74x164.c > +++ b/drivers/gpio/gpio-74x164.c > @@ -165,7 +165,6 @@ static void gen_74x164_remove(struct spi_device *spi) > > static const struct spi_device_id gen_74x164_spi_ids[] = { > { .name = "74hc595" }, > - { .name = "74hc595a" }, Hm, strictly speaking this is not related. What if some spi-driver-matching uses 74hc595a? There is no compatibility for such matches. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/2] dt-bindings: gpio: fairchild,74hc595: use a fallback for Semi MC74HC595A 2025-01-10 13:00 [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver Bartosz Golaszewski 2025-01-10 13:00 ` [PATCH 1/2] Revert "gpio: 74x164: Add On Semi MC74HC595A compat" Bartosz Golaszewski @ 2025-01-10 13:00 ` Bartosz Golaszewski 2025-01-11 10:50 ` Krzysztof Kozlowski 2025-01-10 13:32 ` [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver Csókás Bence 2 siblings, 1 reply; 13+ messages in thread From: Bartosz Golaszewski @ 2025-01-10 13:00 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, Csókás Bence, Geert Uytterhoeven via gmail . com Cc: linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> This model is 1:1 compatible with fairchild,74hc595 so use the latter as a fallback instead of adding a new stand-alone compatible. Fixes: 0ba6cec7acbb ("dt-bindings: gpio: fairchild,74hc595: Add On Semi MC74HC595A compat") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> --- .../devicetree/bindings/gpio/fairchild,74hc595.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml b/Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml index a209c5b4f6e0..da462dddb140 100644 --- a/Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml +++ b/Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml @@ -28,10 +28,12 @@ maintainers: properties: compatible: - enum: - - fairchild,74hc595 - - nxp,74lvc594 - - onnn,74hc595a + oneOf: + - const: fairchild,74hc595 + - const: nxp,74lvc594 + - items: + - const: onnn,74hc595a + - const: fairchild,74hc595 reg: maxItems: 1 -- 2.45.2 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] dt-bindings: gpio: fairchild,74hc595: use a fallback for Semi MC74HC595A 2025-01-10 13:00 ` [PATCH 2/2] dt-bindings: gpio: fairchild,74hc595: use a fallback for Semi MC74HC595A Bartosz Golaszewski @ 2025-01-11 10:50 ` Krzysztof Kozlowski 0 siblings, 0 replies; 13+ messages in thread From: Krzysztof Kozlowski @ 2025-01-11 10:50 UTC (permalink / raw) To: Bartosz Golaszewski Cc: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, Csókás Bence, Geert Uytterhoeven via gmail . com, linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski On Fri, Jan 10, 2025 at 02:00:25PM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > This model is 1:1 compatible with fairchild,74hc595 so use the latter as > a fallback instead of adding a new stand-alone compatible. > > Fixes: 0ba6cec7acbb ("dt-bindings: gpio: fairchild,74hc595: Add On Semi MC74HC595A compat") > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > --- > .../devicetree/bindings/gpio/fairchild,74hc595.yaml | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml b/Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml > index a209c5b4f6e0..da462dddb140 100644 > --- a/Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml > +++ b/Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml > @@ -28,10 +28,12 @@ maintainers: > > properties: > compatible: > - enum: > - - fairchild,74hc595 > - - nxp,74lvc594 > - - onnn,74hc595a > + oneOf: > + - const: fairchild,74hc595 > + - const: nxp,74lvc594 Keep enum for these two, preferred pattern. > + - items: > + - const: onnn,74hc595a > + - const: fairchild,74hc595 Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver 2025-01-10 13:00 [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver Bartosz Golaszewski 2025-01-10 13:00 ` [PATCH 1/2] Revert "gpio: 74x164: Add On Semi MC74HC595A compat" Bartosz Golaszewski 2025-01-10 13:00 ` [PATCH 2/2] dt-bindings: gpio: fairchild,74hc595: use a fallback for Semi MC74HC595A Bartosz Golaszewski @ 2025-01-10 13:32 ` Csókás Bence 2025-01-10 13:38 ` Bartosz Golaszewski 2025-01-11 10:56 ` Krzysztof Kozlowski 2 siblings, 2 replies; 13+ messages in thread From: Csókás Bence @ 2025-01-10 13:32 UTC (permalink / raw) To: Bartosz Golaszewski, Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, Geert Uytterhoeven via gmail . com Cc: linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski Hi, On 2025. 01. 10. 14:00, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > There were other suggested solutions (for instance: just use the > existing compatible for the On Semi variant) but I figured the most > common approach is to use a fallback value for 100% compatible models > and this is what Rob suggested as well. > > This reverts the driver change and makes the "onnn,74hc595a" compatible > use "fairchild,74hc595" as fallback. Is there any reason to introduce a new compatible name at all? Does some pre-existing, widely-used DT blob use it in the wild already? If not, then I don't think it's necessary; for any new boards, their DT's authors should just use the pre-existing names. I'm especially against introducing a new, vendor-specific (On Semi, in this case) name; if we really want to introduce a new compatible, at least make it as generic as possible, i.e. `generic,74x595`, or even `generic,spi-shift-register-output`. > Bartosz Golaszewski (2): > Revert "gpio: 74x164: Add On Semi MC74HC595A compat" > dt-bindings: gpio: fairchild,74hc595: use a fallback for Semi > MC74HC595A > > .../devicetree/bindings/gpio/fairchild,74hc595.yaml | 10 ++++++---- > drivers/gpio/gpio-74x164.c | 2 -- > 2 files changed, 6 insertions(+), 6 deletions(-) Bence ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver 2025-01-10 13:32 ` [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver Csókás Bence @ 2025-01-10 13:38 ` Bartosz Golaszewski 2025-01-10 14:09 ` Geert Uytterhoeven 2025-01-11 10:56 ` Krzysztof Kozlowski 1 sibling, 1 reply; 13+ messages in thread From: Bartosz Golaszewski @ 2025-01-10 13:38 UTC (permalink / raw) To: Csókás Bence Cc: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, Geert Uytterhoeven via gmail . com, linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski On Fri, Jan 10, 2025 at 2:32 PM Csókás Bence <csokas.bence@prolan.hu> wrote: > > Hi, > > On 2025. 01. 10. 14:00, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > > > There were other suggested solutions (for instance: just use the > > existing compatible for the On Semi variant) but I figured the most > > common approach is to use a fallback value for 100% compatible models > > and this is what Rob suggested as well. > > > > This reverts the driver change and makes the "onnn,74hc595a" compatible > > use "fairchild,74hc595" as fallback. > > Is there any reason to introduce a new compatible name at all? Does some > pre-existing, widely-used DT blob use it in the wild already? If not, > then I don't think it's necessary; for any new boards, their DT's > authors should just use the pre-existing names. > I don't have a strong opinion on this and will defer to DT maintainers but a similar case I'm familiar with is the at24 EEPROM driver where we've got lots of 1:1 compatible chips and we tend to add new compatibles to DT bindings (with fallbacks to associated atmel models) just for the sake of correct HW description in DTS. > I'm especially against introducing a new, vendor-specific (On Semi, in > this case) name; if we really want to introduce a new compatible, at > least make it as generic as possible, i.e. `generic,74x595`, or even > `generic,spi-shift-register-output`. > If anything, that would have to be the fallback that the driver knows. The first string in the compatible property has to have an actual vendor (I think, I'll let DT maintainers correct me). Bart > > Bartosz Golaszewski (2): > > Revert "gpio: 74x164: Add On Semi MC74HC595A compat" > > dt-bindings: gpio: fairchild,74hc595: use a fallback for Semi > > MC74HC595A > > > > .../devicetree/bindings/gpio/fairchild,74hc595.yaml | 10 ++++++---- > > drivers/gpio/gpio-74x164.c | 2 -- > > 2 files changed, 6 insertions(+), 6 deletions(-) > > Bence > ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver 2025-01-10 13:38 ` Bartosz Golaszewski @ 2025-01-10 14:09 ` Geert Uytterhoeven 2025-01-10 14:14 ` Bartosz Golaszewski 0 siblings, 1 reply; 13+ messages in thread From: Geert Uytterhoeven @ 2025-01-10 14:09 UTC (permalink / raw) To: Bartosz Golaszewski Cc: Csókás Bence, Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski Hi Bartosz, On Fri, Jan 10, 2025 at 2:38 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote: > On Fri, Jan 10, 2025 at 2:32 PM Csókás Bence <csokas.bence@prolan.hu> wrote: > > On 2025. 01. 10. 14:00, Bartosz Golaszewski wrote: > > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > > > > > There were other suggested solutions (for instance: just use the > > > existing compatible for the On Semi variant) but I figured the most > > > common approach is to use a fallback value for 100% compatible models > > > and this is what Rob suggested as well. > > > > > > This reverts the driver change and makes the "onnn,74hc595a" compatible > > > use "fairchild,74hc595" as fallback. > > > > Is there any reason to introduce a new compatible name at all? Does some > > pre-existing, widely-used DT blob use it in the wild already? If not, > > then I don't think it's necessary; for any new boards, their DT's > > authors should just use the pre-existing names. > > I don't have a strong opinion on this and will defer to DT maintainers > but a similar case I'm familiar with is the at24 EEPROM driver where > we've got lots of 1:1 compatible chips and we tend to add new > compatibles to DT bindings (with fallbacks to associated atmel models) > just for the sake of correct HW description in DTS. At24 EEPROMs differ from '595 shift registers in that they provide an API with multiple commands, and some commands or parameter bits may differ among different implementations (but usually these differences are called quirks). All '595 (I'm deliberately writing it like that) shift registers should be 100% compatible, modulo some electrical specifications (voltage levels, maximum speed, power consumption, ...). Interestingly, the driver is called gpio-74x164.c, while no '164 compatible value is present. Most important difference is that the '164 lacks the output latch, which is used as chip-select with SPI[1]. > > I'm especially against introducing a new, vendor-specific (On Semi, in > > this case) name; if we really want to introduce a new compatible, at > > least make it as generic as possible, i.e. `generic,74x595`, or even > > `generic,spi-shift-register-output`. > > If anything, that would have to be the fallback that the driver knows. > The first string in the compatible property has to have an actual > vendor (I think, I'll let DT maintainers correct me). For the inverse operation (parallel in, serial out), there's just "pisosr-gpio". [1] https://www.ovaga.com/blog/transistor/74hc164-vs-74hc595#simple-list-item-2 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver 2025-01-10 14:09 ` Geert Uytterhoeven @ 2025-01-10 14:14 ` Bartosz Golaszewski 2025-01-11 11:00 ` Krzysztof Kozlowski 0 siblings, 1 reply; 13+ messages in thread From: Bartosz Golaszewski @ 2025-01-10 14:14 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Csókás Bence, Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski On Fri, Jan 10, 2025 at 3:10 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Hi Bartosz, > > On Fri, Jan 10, 2025 at 2:38 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote: > > On Fri, Jan 10, 2025 at 2:32 PM Csókás Bence <csokas.bence@prolan.hu> wrote: > > > On 2025. 01. 10. 14:00, Bartosz Golaszewski wrote: > > > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > > > > > > > There were other suggested solutions (for instance: just use the > > > > existing compatible for the On Semi variant) but I figured the most > > > > common approach is to use a fallback value for 100% compatible models > > > > and this is what Rob suggested as well. > > > > > > > > This reverts the driver change and makes the "onnn,74hc595a" compatible > > > > use "fairchild,74hc595" as fallback. > > > > > > Is there any reason to introduce a new compatible name at all? Does some > > > pre-existing, widely-used DT blob use it in the wild already? If not, > > > then I don't think it's necessary; for any new boards, their DT's > > > authors should just use the pre-existing names. > > > > I don't have a strong opinion on this and will defer to DT maintainers > > but a similar case I'm familiar with is the at24 EEPROM driver where > > we've got lots of 1:1 compatible chips and we tend to add new > > compatibles to DT bindings (with fallbacks to associated atmel models) > > just for the sake of correct HW description in DTS. > > At24 EEPROMs differ from '595 shift registers in that they provide an > API with multiple commands, and some commands or parameter bits may > differ among different implementations (but usually these differences > are called quirks). > > All '595 (I'm deliberately writing it like that) shift registers > should be 100% compatible, modulo some electrical specifications > (voltage levels, maximum speed, power consumption, ...). > > Interestingly, the driver is called gpio-74x164.c, while no '164 > compatible value is present. Most important difference is that the > '164 lacks the output latch, which is used as chip-select with SPI[1]. > > > > I'm especially against introducing a new, vendor-specific (On Semi, in > > > this case) name; if we really want to introduce a new compatible, at > > > least make it as generic as possible, i.e. `generic,74x595`, or even > > > `generic,spi-shift-register-output`. > > > > If anything, that would have to be the fallback that the driver knows. > > The first string in the compatible property has to have an actual > > vendor (I think, I'll let DT maintainers correct me). > > For the inverse operation (parallel in, serial out), there's just > "pisosr-gpio". > Ok, I admit I don't know the correct next step. I'll wait for Krzysztof, Rob or Conor to chime in (on the subject of representing reality - the actual manufacturer - in DTS) and then possibly just remove patches 1-2 from my tree. Bartosz ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver 2025-01-10 14:14 ` Bartosz Golaszewski @ 2025-01-11 11:00 ` Krzysztof Kozlowski 2025-01-12 9:57 ` Geert Uytterhoeven 0 siblings, 1 reply; 13+ messages in thread From: Krzysztof Kozlowski @ 2025-01-11 11:00 UTC (permalink / raw) To: Bartosz Golaszewski, Geert Uytterhoeven Cc: Csókás Bence, Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski On 10/01/2025 15:14, Bartosz Golaszewski wrote: >> At24 EEPROMs differ from '595 shift registers in that they provide an >> API with multiple commands, and some commands or parameter bits may >> differ among different implementations (but usually these differences >> are called quirks). >> >> All '595 (I'm deliberately writing it like that) shift registers >> should be 100% compatible, modulo some electrical specifications >> (voltage levels, maximum speed, power consumption, ...). >> >> Interestingly, the driver is called gpio-74x164.c, while no '164 >> compatible value is present. Most important difference is that the >> '164 lacks the output latch, which is used as chip-select with SPI[1]. >> >>>> I'm especially against introducing a new, vendor-specific (On Semi, in >>>> this case) name; if we really want to introduce a new compatible, at >>>> least make it as generic as possible, i.e. `generic,74x595`, or even >>>> `generic,spi-shift-register-output`. >>> >>> If anything, that would have to be the fallback that the driver knows. >>> The first string in the compatible property has to have an actual >>> vendor (I think, I'll let DT maintainers correct me). >> >> For the inverse operation (parallel in, serial out), there's just >> "pisosr-gpio". >> > > Ok, I admit I don't know the correct next step. I'll wait for > Krzysztof, Rob or Conor to chime in (on the subject of representing > reality - the actual manufacturer - in DTS) and then possibly just > remove patches 1-2 from my tree. > Well, folks, I don't know the exact device, so maybe there is no point in a new compatible if there is a claim all devices have same interface and documenting all of them would result in 1000 redundant compatibles... but OTOH, that's what we still do with jedec,spi and at24, so if we can add specific compatibles for these, we can do same also here. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver 2025-01-11 11:00 ` Krzysztof Kozlowski @ 2025-01-12 9:57 ` Geert Uytterhoeven 2025-01-13 8:22 ` Bartosz Golaszewski 0 siblings, 1 reply; 13+ messages in thread From: Geert Uytterhoeven @ 2025-01-12 9:57 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Bartosz Golaszewski, Csókás Bence, Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski Hi Krzysztof, On Sat, Jan 11, 2025 at 12:00 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > On 10/01/2025 15:14, Bartosz Golaszewski wrote: > >> At24 EEPROMs differ from '595 shift registers in that they provide an > >> API with multiple commands, and some commands or parameter bits may > >> differ among different implementations (but usually these differences > >> are called quirks). > >> > >> All '595 (I'm deliberately writing it like that) shift registers > >> should be 100% compatible, modulo some electrical specifications > >> (voltage levels, maximum speed, power consumption, ...). > >> > >> Interestingly, the driver is called gpio-74x164.c, while no '164 > >> compatible value is present. Most important difference is that the > >> '164 lacks the output latch, which is used as chip-select with SPI[1]. > >> > >>>> I'm especially against introducing a new, vendor-specific (On Semi, in > >>>> this case) name; if we really want to introduce a new compatible, at > >>>> least make it as generic as possible, i.e. `generic,74x595`, or even > >>>> `generic,spi-shift-register-output`. > >>> > >>> If anything, that would have to be the fallback that the driver knows. > >>> The first string in the compatible property has to have an actual > >>> vendor (I think, I'll let DT maintainers correct me). > >> > >> For the inverse operation (parallel in, serial out), there's just > >> "pisosr-gpio". > > > > Ok, I admit I don't know the correct next step. I'll wait for > > Krzysztof, Rob or Conor to chime in (on the subject of representing > > reality - the actual manufacturer - in DTS) and then possibly just > > remove patches 1-2 from my tree. > > Well, folks, I don't know the exact device, so maybe there is no point > in a new compatible if there is a claim all devices have same interface > and documenting all of them would result in 1000 redundant > compatibles... but OTOH, that's what we still do with jedec,spi and > at24, so if we can add specific compatibles for these, we can do same > also here. Except that we don't for jedec,spi, unfortunately[1]. At24 and jedec,spi use a complex programming API, with lots of room for deviation and extension. '595 is a pure hardware part[2]: it is just a shift register (driven by SPI clock and MOSI) with a latch (driven by deasserting SPI chip select), without room for deviation. Anything that behaves differently is not a jelly-bean '595 part. [1] "[PATCH] dt-bindings: mtd: jedec,spi-nor: Document support for more MT25QU parts' https://lore.kernel.org/all/363186079b4269891073f620e3e2353cf7d2559a.1669988238.git.geert+renesas@glider.be [2] Ignoring the rumor that all Microchip I/O expanders are actually pre-programmed PIC microcontrollers ;-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver 2025-01-12 9:57 ` Geert Uytterhoeven @ 2025-01-13 8:22 ` Bartosz Golaszewski 0 siblings, 0 replies; 13+ messages in thread From: Bartosz Golaszewski @ 2025-01-13 8:22 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Krzysztof Kozlowski, Csókás Bence, Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski On Sun, Jan 12, 2025 at 10:58 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Hi Krzysztof, > > On Sat, Jan 11, 2025 at 12:00 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On 10/01/2025 15:14, Bartosz Golaszewski wrote: > > >> At24 EEPROMs differ from '595 shift registers in that they provide an > > >> API with multiple commands, and some commands or parameter bits may > > >> differ among different implementations (but usually these differences > > >> are called quirks). > > >> > > >> All '595 (I'm deliberately writing it like that) shift registers > > >> should be 100% compatible, modulo some electrical specifications > > >> (voltage levels, maximum speed, power consumption, ...). > > >> > > >> Interestingly, the driver is called gpio-74x164.c, while no '164 > > >> compatible value is present. Most important difference is that the > > >> '164 lacks the output latch, which is used as chip-select with SPI[1]. > > >> > > >>>> I'm especially against introducing a new, vendor-specific (On Semi, in > > >>>> this case) name; if we really want to introduce a new compatible, at > > >>>> least make it as generic as possible, i.e. `generic,74x595`, or even > > >>>> `generic,spi-shift-register-output`. > > >>> > > >>> If anything, that would have to be the fallback that the driver knows. > > >>> The first string in the compatible property has to have an actual > > >>> vendor (I think, I'll let DT maintainers correct me). > > >> > > >> For the inverse operation (parallel in, serial out), there's just > > >> "pisosr-gpio". > > > > > > Ok, I admit I don't know the correct next step. I'll wait for > > > Krzysztof, Rob or Conor to chime in (on the subject of representing > > > reality - the actual manufacturer - in DTS) and then possibly just > > > remove patches 1-2 from my tree. > > > > Well, folks, I don't know the exact device, so maybe there is no point > > in a new compatible if there is a claim all devices have same interface > > and documenting all of them would result in 1000 redundant > > compatibles... but OTOH, that's what we still do with jedec,spi and > > at24, so if we can add specific compatibles for these, we can do same > > also here. > > Except that we don't for jedec,spi, unfortunately[1]. > > At24 and jedec,spi use a complex programming API, with lots of room > for deviation and extension. '595 is a pure hardware part[2]: it is > just a shift register (driven by SPI clock and MOSI) with a latch > (driven by deasserting SPI chip select), without room for deviation. > Anything that behaves differently is not a jelly-bean '595 part. > > [1] "[PATCH] dt-bindings: mtd: jedec,spi-nor: Document support for > more MT25QU parts' > https://lore.kernel.org/all/363186079b4269891073f620e3e2353cf7d2559a.1669988238.git.geert+renesas@glider.be > > [2] Ignoring the rumor that all Microchip I/O expanders are actually > pre-programmed PIC microcontrollers ;-) It's late into the cycle and as it's not clear whether we really need the new compatible or not, I removed the two patches from my queue. Let's revisit it in the next release. Bartosz ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver 2025-01-10 13:32 ` [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver Csókás Bence 2025-01-10 13:38 ` Bartosz Golaszewski @ 2025-01-11 10:56 ` Krzysztof Kozlowski 1 sibling, 0 replies; 13+ messages in thread From: Krzysztof Kozlowski @ 2025-01-11 10:56 UTC (permalink / raw) To: Csókás Bence, Bartosz Golaszewski, Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard, J . Neuschäfer, Geert Uytterhoeven via gmail . com Cc: linux-gpio, devicetree, linux-kernel, Bartosz Golaszewski On 10/01/2025 14:32, Csókás Bence wrote: > Hi, > > On 2025. 01. 10. 14:00, Bartosz Golaszewski wrote: >> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> >> >> There were other suggested solutions (for instance: just use the >> existing compatible for the On Semi variant) but I figured the most >> common approach is to use a fallback value for 100% compatible models >> and this is what Rob suggested as well. >> >> This reverts the driver change and makes the "onnn,74hc595a" compatible >> use "fairchild,74hc595" as fallback. > > Is there any reason to introduce a new compatible name at all? Does some Yes, DT bindings preference, see writing bindings. I assume of course this is a separate device. You cannot use other compatible "foo" for some other device "bar". Best regards, Krzysztof ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-01-13 8:22 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-01-10 13:00 [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver Bartosz Golaszewski 2025-01-10 13:00 ` [PATCH 1/2] Revert "gpio: 74x164: Add On Semi MC74HC595A compat" Bartosz Golaszewski 2025-01-11 10:53 ` Krzysztof Kozlowski 2025-01-10 13:00 ` [PATCH 2/2] dt-bindings: gpio: fairchild,74hc595: use a fallback for Semi MC74HC595A Bartosz Golaszewski 2025-01-11 10:50 ` Krzysztof Kozlowski 2025-01-10 13:32 ` [PATCH 0/2] gpio: 74x164: use a compatible fallback and don't extend the driver Csókás Bence 2025-01-10 13:38 ` Bartosz Golaszewski 2025-01-10 14:09 ` Geert Uytterhoeven 2025-01-10 14:14 ` Bartosz Golaszewski 2025-01-11 11:00 ` Krzysztof Kozlowski 2025-01-12 9:57 ` Geert Uytterhoeven 2025-01-13 8:22 ` Bartosz Golaszewski 2025-01-11 10:56 ` Krzysztof Kozlowski
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).