Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1646875 > unrolled thread
| Started by | Nikita Yushchenko <nikita.yoush@cogentembedded.com> |
|---|---|
| First post | 2017-05-22 15:20 +0200 |
| Last post | 2017-05-23 08:10 +0200 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2017-05-22 15:20 +0200
Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device Stefan Agner <stefan@agner.ch> - 2017-05-22 18:30 +0200
Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2017-05-22 18:30 +0200
Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device Andrew Lunn <andrew@lunn.ch> - 2017-05-22 20:30 +0200
Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2017-05-23 08:10 +0200
| From | Nikita Yushchenko <nikita.yoush@cogentembedded.com> |
|---|---|
| Date | 2017-05-22 15:20 +0200 |
| Subject | [PATCH] ARM: dts: vf610-zii-dev-rev-b: add hi8435 device |
| Message-ID | <tJVpD-6c9-9@gated-at.bofh.it> |
ZII dev board rev B has a Holt Hi8435 connected to dspi2.
Add it to device tree.
ZII dev board rev C does not have that, so use rev-b dts file,
not common dtsi file.
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
---
arch/arm/boot/dts/vf610-zii-dev-rev-b.dts | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts b/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts
index 37f95427616f..f433465c3a7c 100644
--- a/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts
+++ b/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts
@@ -348,6 +348,25 @@
};
};
+&edma1 {
+ status = "okay";
+};
+
+&dspi2 {
+ bus-num = <1>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_dspi2>;
+ status = "okay";
+ spi-num-chipselects = <2>;
+
+ hi8435@1 {
+ compatible = "holt,hi8435";
+ reg = <1>;
+ spi-max-frequency = <20000000>;
+ gpios = <&gpio5 3 0>;
+ };
+};
+
&i2c0 {
clock-frequency = <100000>;
pinctrl-names = "default";
--
2.11.0
[toc] | [next] | [standalone]
| From | Stefan Agner <stefan@agner.ch> |
|---|---|
| Date | 2017-05-22 18:30 +0200 |
| Message-ID | <tJYnw-80c-25@gated-at.bofh.it> |
| In reply to | #1646875 |
On 2017-05-22 06:10, Nikita Yushchenko wrote:
> ZII dev board rev B has a Holt Hi8435 connected to dspi2.
> Add it to device tree.
>
> ZII dev board rev C does not have that, so use rev-b dts file,
> not common dtsi file.
>
> Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
> ---
> arch/arm/boot/dts/vf610-zii-dev-rev-b.dts | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts
> b/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts
> index 37f95427616f..f433465c3a7c 100644
> --- a/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts
> +++ b/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts
> @@ -348,6 +348,25 @@
> };
> };
>
> +&edma1 {
> + status = "okay";
> +};
> +
> +&dspi2 {
> + bus-num = <1>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_dspi2>;
> + status = "okay";
> + spi-num-chipselects = <2>;
> +
> + hi8435@1 {
> + compatible = "holt,hi8435";
> + reg = <1>;
> + spi-max-frequency = <20000000>;
> + gpios = <&gpio5 3 0>;
Nit: GPIO_ACTIVE_HIGH instead of 0?
--
Stefan
> + };
> +};
> +
> &i2c0 {
> clock-frequency = <100000>;
> pinctrl-names = "default";
[toc] | [prev] | [next] | [standalone]
| From | Nikita Yushchenko <nikita.yoush@cogentembedded.com> |
|---|---|
| Date | 2017-05-22 18:30 +0200 |
| Message-ID | <tJYnw-80c-33@gated-at.bofh.it> |
| In reply to | #1647111 |
>> + hi8435@1 {
>> + compatible = "holt,hi8435";
>> + reg = <1>;
>> + spi-max-frequency = <20000000>;
>> + gpios = <&gpio5 3 0>;
>
> Nit: GPIO_ACTIVE_HIGH instead of 0?
Gray area here.
Chip's reset input is active LOW.
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.
Far not ideal but better than device trees explicitly stating
GPIO_ACTIVE_HIGH while it is active low.
Nikita
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-05-22 20:30 +0200 |
| Message-ID | <tK0fD-HF-7@gated-at.bofh.it> |
| In reply to | #1647114 |
On Mon, May 22, 2017 at 07:29:14PM +0300, Nikita Yushchenko wrote:
> >> + hi8435@1 {
> >> + compatible = "holt,hi8435";
> >> + reg = <1>;
> >> + spi-max-frequency = <20000000>;
> >> + gpios = <&gpio5 3 0>;
> >
> > Nit: GPIO_ACTIVE_HIGH instead of 0?
>
> Gray area here.
>
> Chip's reset input is active LOW.
Nikita
There second issue here is that you are going to be getting newbies
looking at .dts files and submitting patches to replace the 0 with
GPIO_ACTIVE_HIGH in all files, just like they submit patches fixing
checkpatch warnings.
> 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.
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Nikita Yushchenko <nikita.yoush@cogentembedded.com> |
|---|---|
| Date | 2017-05-23 08:10 +0200 |
| Message-ID | <tKbb4-7G0-9@gated-at.bofh.it> |
| In reply to | #1647245 |
>> 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.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web