Skip to contentSkip to conversation

input: misc: Add IBM Operation Panel driver

PATCH Superseded Eddie James 2 participants 4 messages Feb 24, 2022 – Feb 25, 2022

Subsystems (4)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Eddie James

author maintainer
#0 lore raw

v4 cover input: misc: Add IBM Operation Panel driver

This series adds support for input from the IBM Operation Panel, which is a simple controller with three buttons and an LCD display meant for interacting with a server. It's connected over I2C, typically to a service processor. This series only supports the input from the panel, in which the panel masters the I2C bus and sends data to the host system when someone presses a button on the controller.

Changes since v3:
- Document linux,keycodes property
- Use linux,keycodes property to map the buttons
- Put the checksumming in a seperate function
- Don't do unneccessary input_unregister calls
- Minor cleanup and add debug data to dev_dbg calls

Changes since v2:
- Add "additionalProperties: false" to dts doc
- Refactor switch statement in the input driver; check command size and call the processing function within the STOP case
- Use a different definition name for Aspeed interrupt status mask

Changes since v1:
- Redo DTS documentation example to use I2C_OWN_SLAVE_ADDRESS
- Reject commands received in the input driver that are too long
- Add a definition for the interrupt status mask in the Aspeed I2C driver
- Use I2C_OWN_SLAVE_ADDRESS for both dts additions

Eddie James (2):
dt-bindings: input: Add documentation for IBM Operation Panel
input: misc: Add IBM Operation Panel driver

 .../bindings/input/ibm,op-panel.yaml          |  49 +++++
 MAINTAINERS                                   |   7 +
 drivers/input/misc/Kconfig                    |  18 ++
 drivers/input/misc/Makefile                   |   1 +
 drivers/input/misc/ibm-panel.c                | 198 ++++++++++++++++++
 5 files changed, 273 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/ibm,op-panel.yaml
 create mode 100644 drivers/input/misc/ibm-panel.c
Signature · 1 line
2.27.0
author maintainer
#1 lore raw

PATCH v4 1/2 dt-bindings: input: Add documentation for IBM Operation Panel

Document the bindings for the IBM Operation Panel, which provides a simple interface to control a server. It has a display and three buttons.
Also update MAINTAINERS for the new file.

---
 .../bindings/input/ibm,op-panel.yaml          | 49 +++++++++++++++++++
 MAINTAINERS                                   |  6 +++
 2 files changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/ibm,op-panel.yaml
Documentation/devicetree/bindings/input/ibm,op-panel.yaml new file +49 -0
new file mode 100644
index 000000000000..08d8f194f0db
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/ibm,op-panel.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IBM Operation Panel
+
+maintainers:
+  - Eddie James <[email protected]>
+
+allOf:
+  - $ref: input.yaml#
+
+description: |
+  The IBM Operation Panel provides a simple interface to control the connected
+  server. It has a display and three buttons: two directional arrows and one
+  'Enter' button.
+
+properties:
+  compatible:
+    const: ibm,op-panel
+
+  reg:
+    maxItems: 1
+
+  linux,keycodes:
+    minItems: 1
+    maxItems: 3
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/i2c/i2c.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ibm-op-panel@62 {
+            compatible = "ibm,op-panel";
+            reg = <(0x62 | I2C_OWN_SLAVE_ADDRESS)>;
+            linux,keycodes = <KEY_UP KEY_DOWN KEY_ENTER>;
+        };
+    };
MAINTAINERS +6 -0
index d2eef29691e7..f4c9db336223 100644
@@ -9233,6 +9233,12 @@ S:	Orphan
 F:	Documentation/ia64/
 F:	arch/ia64/
 
+IBM Operation Panel Input Driver
+M:	Eddie James <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/input/ibm,op-panel.yaml
+
 IBM Power 842 compression accelerator
 M:	Haren Myneni <[email protected]>
 S:	Supported
Signature · 1 line
2.27.0
author maintainer
#3 lore raw

PATCH v4 2/2 input: misc: Add IBM Operation Panel driver

In reply to Eddie James

Add a driver to get the button events from the panel and provide them to userspace with the input subsystem. The panel is connected with I2C and controls the bus, so the driver registers as an I2C slave device.

---
 MAINTAINERS                    |   1 +
 drivers/input/misc/Kconfig     |  18 +++
 drivers/input/misc/Makefile    |   1 +
 drivers/input/misc/ibm-panel.c | 198 +++++++++++++++++++++++++++++++++
 4 files changed, 218 insertions(+)
 create mode 100644 drivers/input/misc/ibm-panel.c
MAINTAINERS +1 -0
index f4c9db336223..c69fd88774d4 100644
@@ -9238,6 +9238,7 @@ M:	Eddie James <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	Documentation/devicetree/bindings/input/ibm,op-panel.yaml
+F:	drivers/input/misc/ibm-panel.c
 
 IBM Power 842 compression accelerator
 M:	Haren Myneni <[email protected]>
drivers/input/misc/Kconfig +18 -0
index dd5227cf8696..783cc4bf3ef7 100644
@@ -730,6 +730,24 @@ config INPUT_ADXL34X_SPI
 	  To compile this driver as a module, choose M here: the
 	  module will be called adxl34x-spi.
 
+config INPUT_IBM_PANEL
+	tristate "IBM Operation Panel driver"
+	depends on I2C_SLAVE || COMPILE_TEST
+	help
+	  Say Y here if you have an IBM Operation Panel connected to your system
+	  over I2C. The panel is typically connected only to a system's service
+	  processor (BMC).
+
+	  If unsure, say N.
+
+	  The Operation Panel is a controller with some buttons and an LCD
+	  display that allows someone with physical access to the system to
+	  perform various administrative tasks. This driver only supports the part
+	  of the controller that sends commands to the system.
+
+	  To compile this driver as a module, choose M here: the module will be
+	  called ibm-panel.
+
 config INPUT_IMS_PCU
 	tristate "IMS Passenger Control Unit driver"
 	depends on USB
drivers/input/misc/Makefile +1 -0
index b92c53a6b5ae..970afe013539 100644
@@ -41,6 +41,7 @@ obj-$(CONFIG_INPUT_GPIO_DECODER)	+= gpio_decoder.o
 obj-$(CONFIG_INPUT_GPIO_VIBRA)		+= gpio-vibra.o
 obj-$(CONFIG_INPUT_HISI_POWERKEY)	+= hisi_powerkey.o
 obj-$(CONFIG_HP_SDC_RTC)		+= hp_sdc_rtc.o
+obj-$(CONFIG_INPUT_IBM_PANEL)		+= ibm-panel.o
 obj-$(CONFIG_INPUT_IMS_PCU)		+= ims-pcu.o
 obj-$(CONFIG_INPUT_IQS269A)		+= iqs269a.o
 obj-$(CONFIG_INPUT_IQS626A)		+= iqs626a.o
drivers/input/misc/ibm-panel.c new file +198 -0

198 lines not on this page · raw message

Signature · 1 line
2.27.0
maintainer
#2 lore raw

Re: [PATCH v4 1/2] dt-bindings: input: Add documentation for IBM Operation Panel

In reply to Eddie James
Quoted 5 lines · Eddie James

Document the bindings for the IBM Operation Panel, which provides a simple interface to control a server. It has a display and three buttons.
Also update MAINTAINERS for the new file.

Quoted 9 lines
---
 .../bindings/input/ibm,op-panel.yaml          | 49 +++++++++++++++++++
 MAINTAINERS                                   |  6 +++
 2 files changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/ibm,op-panel.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/input/ibm,op-panel.example.dts:27.35-36 syntax error FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:378: Documentation/devicetree/bindings/input/ibm,op-panel.example.dt.yaml] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1398: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1597387

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.