diff mbox

[linux,dev-4.10,v4] ARM: dts: aspeed: Add gpio-keys-polled for fan presence

Message ID 20170720141500.57756-1-cbostic@linux.vnet.ibm.com
State Accepted, archived
Headers show

Commit Message

Christopher Bostic July 20, 2017, 2:15 p.m. UTC
Define gpio-keys-polled.  Add pca-955x chip IO as GPIO source.
Polling period of 1 second determined to be the max acceptable
value based on discussions with Brad Bishop and Matt Spinler.

Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
---
v4 - Add details regarding polling period to commit message.
v3 - Remove 'autorepeat'
   - Increase polling period to 1 second.
   - Remove GPIO specifiers from pca955x in dev tree
v2 - Change 'linux,code' from a unique global value to a local one
     for all the gpio-keys-polled devices.
---
 arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 31 ++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

Comments

Joel Stanley July 26, 2017, 12:14 p.m. UTC | #1
Hi Chris,

On Thu, Jul 20, 2017 at 11:45 PM, Christopher Bostic
<cbostic@linux.vnet.ibm.com> wrote:
>
> +       gpio-keys-polled {
> +               compatible = "gpio-keys-polled";
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               #poll-interval = <1000>;

When I tested it, I saw this:

[    3.630000] gpio-keys-polled gpio-keys-polled: missing poll_interval value
[    3.630000] gpio-keys-polled: probe of gpio-keys-polled failed with error -22

I fixed that property, and I got this:

[    3.620000] OF: /gpio-keys-polled/fan0-presence: could not get
#gpio-cells for /ahb/apb/i2c@1e78a000/i2c-bus@100/pca9552@60
[    3.620000] gpio-keys-polled gpio-keys-polled: failed to get gpio: -22
[    3.620000] gpio-keys-polled: probe of gpio-keys-polled failed with error -22

So I added the gpio-cells to the relevant node, and it probed properly.

Can you please make those two fixes and test that the input events
work as you expected?

Cheers,

Joel
Christopher Bostic July 26, 2017, 9:32 p.m. UTC | #2
On 7/26/17 7:14 AM, Joel Stanley wrote:
> Hi Chris,
>
> On Thu, Jul 20, 2017 at 11:45 PM, Christopher Bostic
> <cbostic@linux.vnet.ibm.com> wrote:
>> +       gpio-keys-polled {
>> +               compatible = "gpio-keys-polled";
>> +               #address-cells = <1>;
>> +               #size-cells = <0>;
>> +               #poll-interval = <1000>;
> When I tested it, I saw this:
>
> [    3.630000] gpio-keys-polled gpio-keys-polled: missing poll_interval value
> [    3.630000] gpio-keys-polled: probe of gpio-keys-polled failed with error -22
>
> I fixed that property, and I got this:
>
> [    3.620000] OF: /gpio-keys-polled/fan0-presence: could not get
> #gpio-cells for /ahb/apb/i2c@1e78a000/i2c-bus@100/pca9552@60
> [    3.620000] gpio-keys-polled gpio-keys-polled: failed to get gpio: -22
> [    3.620000] gpio-keys-polled: probe of gpio-keys-polled failed with error -22
Sorry about that -missed the probe error, will fix.


Thanks,
Chris


> So I added the gpio-cells to the relevant node, and it probed properly.
>
> Can you please make those two fixes and test that the input events
> work as you expected?
>
> Cheers,
>
> Joel
>
diff mbox

Patch

diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
index 34c5dfc..b18e747 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
@@ -62,6 +62,37 @@ 
 		};
 	};
 
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		#poll-interval = <1000>;
+
+		fan0-presence {
+			label = "fan0-presence";
+			gpios = <&pca0 4 GPIO_ACTIVE_LOW>;
+			linux,code = <4>;
+		};
+
+		fan1-presence {
+			label = "fan1-presence";
+			gpios = <&pca0 5 GPIO_ACTIVE_LOW>;
+			linux,code = <5>;
+		};
+
+		fan2-presence {
+			label = "fan2-presence";
+			gpios = <&pca0 6 GPIO_ACTIVE_LOW>;
+			linux,code = <6>;
+		};
+
+		fan3-presence {
+			label = "fan3-presence";
+			gpios = <&pca0 7 GPIO_ACTIVE_LOW>;
+			linux,code = <7>;
+		};
+	};
+
 	leds {
 		compatible = "gpio-leds";