From patchwork Tue Sep 8 20:00:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 293973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2774BC2D0A7 for ; Tue, 8 Sep 2020 20:01:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D93D1207DE for ; Tue, 8 Sep 2020 20:01:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="SirpuTCr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732582AbgIHUB6 (ORCPT ); Tue, 8 Sep 2020 16:01:58 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:15072 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729988AbgIHUBY (ORCPT ); Tue, 8 Sep 2020 16:01:24 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 088JXZto010145; Tue, 8 Sep 2020 16:01:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=MHEf0n9vUOLrK3bD/Vy6e2g7Yf/X+egArwXFxhmjvqY=; b=SirpuTCrrbCGkTBQ72J64TLB1rsFu4w5qb7FapGpmyOZcxq3KIXMZD3nHiAubxfLACIr qqlV2rUFutxYqOdJGk8L3XsNtfF/bid8qZyJ6Grn+HT7K41imaRppRMVT4Hxe2PcqD/B A3IA7RI8fGIYG6bj9nDOWHO8Jk4DOAOB/NSjeL6fRfoS8ei/6H5iTmagOTSFh56TCa6m Cc31VUF3LcX8TMNlvHk6xhLv1AGKpgmmR6qYm7fi5T8ofp6Z0QSv5xAAfkvoGhFlNSrI KDTc7CBikez6xPutStZBs4HwToPLT9gboy4WDgv09Y6ryQjHbuaxnoS2IxC3bMQhf37m eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33eg3frswr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:06 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 088JeCN5052731; Tue, 8 Sep 2020 16:01:06 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 33eg3frsw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:06 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 088JwGog025156; Tue, 8 Sep 2020 20:01:05 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma03dal.us.ibm.com with ESMTP id 33c2a90cpm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 20:01:05 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 088K10Hm66191720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Sep 2020 20:01:00 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D70426A057; Tue, 8 Sep 2020 20:01:03 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D3806A047; Tue, 8 Sep 2020 20:01:03 +0000 (GMT) Received: from SHADE6A.ibmuc.com (unknown [9.163.24.203]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 8 Sep 2020 20:01:03 +0000 (GMT) From: Eddie James To: linux-input@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-i2c@vger.kernel.org, joel@jms.id.au, andrew@aj.id.au, benh@kernel.crashing.org, brendanhiggins@google.com, dmitry.torokhov@gmail.com, robh+dt@kernel.org, wsa@kernel.org, rentao.bupt@gmail.com, ryan_chen@aspeedtech.com Subject: [PATCH v2 1/5] dt-bindings: input: Add documentation for IBM Operation Panel Date: Tue, 8 Sep 2020 15:00:57 -0500 Message-Id: <20200908200101.64974-2-eajames@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200908200101.64974-1-eajames@linux.ibm.com> References: <20200908200101.64974-1-eajames@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-08_09:2020-09-08,2020-09-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009080179 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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. Signed-off-by: Eddie James Acked-by: Joel Stanley --- .../bindings/input/ibm,op-panel.yaml | 39 +++++++++++++++++++ MAINTAINERS | 6 +++ 2 files changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/ibm,op-panel.yaml diff --git a/Documentation/devicetree/bindings/input/ibm,op-panel.yaml b/Documentation/devicetree/bindings/input/ibm,op-panel.yaml new file mode 100644 index 000000000000..5f068fce93ad --- /dev/null +++ b/Documentation/devicetree/bindings/input/ibm,op-panel.yaml @@ -0,0 +1,39 @@ +# 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 + +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 + +required: + - compatible + - reg + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + ibm-op-panel@62 { + compatible = "ibm,op-panel"; + reg = <(0x62 | I2C_OWN_SLAVE_ADDRESS)>; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 4a5d6797a206..0d83eada50e4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8345,6 +8345,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git F: Documentation/ia64/ F: arch/ia64/ +IBM Operation Panel Input Driver +M: Eddie James +L: linux-input@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/input/ibm,op-panel.yaml + IBM Power 842 compression accelerator M: Haren Myneni S: Supported From patchwork Tue Sep 8 20:00:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 255005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49C0CC2BC11 for ; Tue, 8 Sep 2020 20:01:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13B1820768 for ; Tue, 8 Sep 2020 20:01:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="btuHUGXW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730726AbgIHUBv (ORCPT ); Tue, 8 Sep 2020 16:01:51 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:7264 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732582AbgIHUB0 (ORCPT ); Tue, 8 Sep 2020 16:01:26 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 088K0urT029137; Tue, 8 Sep 2020 16:01:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=mwl+xjJTA3PtBzyEYrKktAJb0WXR7n7VdUze2QgexjI=; b=btuHUGXWQB8ysA1C+x+cEuPoU0oaoY3D/dwndFROAmQC+yFMg1BMLs/TpEzvFgYqdL2y xXTTScis/eZM1k6C7izvsMt/mUSxaxGwdVpYOmwd0+Xda1bpcxLa81h42vXI2Bv3AJ73 yZPi38Bz+UiP12ZQbv+81wSfR3tDRGGivFHbUqiR7JI+FOq9wMe/I0avUp6HPiurg6wJ mj6G6dZZi3gf2GPyNiPHTjtVujIDf/GVgzus4DB2EyT7KmSaiIVy3t6zR2YHNAAUv1+I rtHZALK1e0XqyszFQy5f6IuJSUP8MSje4KbwCZnPgYrElY0l0nenUNU8duzLdfGR0LIf Hw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 33egm100ns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:08 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 088K18FG030016; Tue, 8 Sep 2020 16:01:08 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com with ESMTP id 33egm100m9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:07 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 088JvbvP002957; Tue, 8 Sep 2020 20:01:05 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01wdc.us.ibm.com with ESMTP id 33c2a8svw0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 20:01:05 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 088K0xih64946514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Sep 2020 20:00:59 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A15156A064; Tue, 8 Sep 2020 20:01:04 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA1886A047; Tue, 8 Sep 2020 20:01:03 +0000 (GMT) Received: from SHADE6A.ibmuc.com (unknown [9.163.24.203]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 8 Sep 2020 20:01:03 +0000 (GMT) From: Eddie James To: linux-input@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-i2c@vger.kernel.org, joel@jms.id.au, andrew@aj.id.au, benh@kernel.crashing.org, brendanhiggins@google.com, dmitry.torokhov@gmail.com, robh+dt@kernel.org, wsa@kernel.org, rentao.bupt@gmail.com, ryan_chen@aspeedtech.com Subject: [PATCH v2 2/5] input: misc: Add IBM Operation Panel driver Date: Tue, 8 Sep 2020 15:00:58 -0500 Message-Id: <20200908200101.64974-3-eajames@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200908200101.64974-1-eajames@linux.ibm.com> References: <20200908200101.64974-1-eajames@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-08_09:2020-09-08,2020-09-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 suspectscore=1 lowpriorityscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009080179 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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. Signed-off-by: Eddie James Reviewed-by: Joel Stanley --- MAINTAINERS | 1 + drivers/input/misc/Kconfig | 18 ++++ drivers/input/misc/Makefile | 1 + drivers/input/misc/ibm-panel.c | 192 +++++++++++++++++++++++++++++++++ 4 files changed, 212 insertions(+) create mode 100644 drivers/input/misc/ibm-panel.c diff --git a/MAINTAINERS b/MAINTAINERS index 0d83eada50e4..0f9605c4cfc6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8350,6 +8350,7 @@ M: Eddie James L: linux-input@vger.kernel.org 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 diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 362e8a01980c..65ab1ce7b259 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -708,6 +708,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 diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index a48e5f2d859d..7e9edf0a142b 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile @@ -38,6 +38,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_IXP4XX_BEEPER) += ixp4xx-beeper.o diff --git a/drivers/input/misc/ibm-panel.c b/drivers/input/misc/ibm-panel.c new file mode 100644 index 000000000000..7b147b090c2a --- /dev/null +++ b/drivers/input/misc/ibm-panel.c @@ -0,0 +1,192 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) IBM Corporation 2020 + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEVICE_NAME "ibm-panel" + +struct ibm_panel { + u8 idx; + u8 command[11]; + spinlock_t lock; /* protects writes to idx and command */ + struct input_dev *input; +}; + +static void ibm_panel_process_command(struct ibm_panel *panel, u8 command_size) +{ + u8 i; + u8 chksum; + u16 sum = 0; + int pressed; + int released; + + if (command_size != sizeof(panel->command)) { + dev_dbg(&panel->input->dev, "command size incorrect\n"); + return; + } + + if (panel->command[0] != 0xff && panel->command[1] != 0xf0) { + dev_dbg(&panel->input->dev, "command invalid\n"); + return; + } + + for (i = 0; i < sizeof(panel->command) - 1; ++i) { + sum += panel->command[i]; + if (sum & 0xff00) { + sum &= 0xff; + sum++; + } + } + + chksum = sum & 0xff; + chksum = ~chksum; + chksum++; + + if (chksum != panel->command[sizeof(panel->command) - 1]) { + dev_dbg(&panel->input->dev, "command failed checksum\n"); + return; + } + + released = panel->command[2] & 0x80; + pressed = released ? 0 : 1; + + switch (panel->command[2] & 0xf) { + case 0: + input_report_key(panel->input, BTN_NORTH, pressed); + break; + case 1: + input_report_key(panel->input, BTN_SOUTH, pressed); + break; + case 2: + input_report_key(panel->input, BTN_SELECT, pressed); + break; + default: + dev_dbg(&panel->input->dev, "unknown command %u\n", + panel->command[2] & 0xf); + return; + } + + input_sync(panel->input); +} + +static int ibm_panel_i2c_slave_cb(struct i2c_client *client, + enum i2c_slave_event event, u8 *val) +{ + u8 command_size = 0; + unsigned long flags; + struct ibm_panel *panel = i2c_get_clientdata(client); + + dev_dbg(&panel->input->dev, "event: %u data: %02x\n", event, *val); + + spin_lock_irqsave(&panel->lock, flags); + + switch (event) { + case I2C_SLAVE_STOP: + command_size = panel->idx; + fallthrough; + case I2C_SLAVE_WRITE_REQUESTED: + panel->idx = 0; + break; + case I2C_SLAVE_WRITE_RECEIVED: + if (panel->idx < sizeof(panel->command)) + panel->command[panel->idx++] = *val; + else + /* + * The command is too long and therefore invalid, so set the index + * to it's largest possible value. When a STOP is finally received, + * the command will be rejected upon processing. + */ + panel->idx = U8_MAX; + break; + default: + break; + } + + spin_unlock_irqrestore(&panel->lock, flags); + + if (command_size) + ibm_panel_process_command(panel, command_size); + + return 0; +} + +static int ibm_panel_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + int rc; + struct ibm_panel *panel = devm_kzalloc(&client->dev, sizeof(*panel), + GFP_KERNEL); + + if (!panel) + return -ENOMEM; + + panel->input = devm_input_allocate_device(&client->dev); + if (!panel->input) + return -ENOMEM; + + panel->input->name = client->name; + panel->input->id.bustype = BUS_I2C; + input_set_capability(panel->input, EV_KEY, BTN_NORTH); + input_set_capability(panel->input, EV_KEY, BTN_SOUTH); + input_set_capability(panel->input, EV_KEY, BTN_SELECT); + + rc = input_register_device(panel->input); + if (rc) { + dev_err(&client->dev, "Failed to register input device: %d\n", + rc); + return rc; + } + + spin_lock_init(&panel->lock); + + i2c_set_clientdata(client, panel); + rc = i2c_slave_register(client, ibm_panel_i2c_slave_cb); + if (rc) { + input_unregister_device(panel->input); + dev_err(&client->dev, + "Failed to register I2C slave device: %d\n", rc); + return rc; + } + + return 0; +} + +static int ibm_panel_remove(struct i2c_client *client) +{ + int rc; + struct ibm_panel *panel = i2c_get_clientdata(client); + + rc = i2c_slave_unregister(client); + + input_unregister_device(panel->input); + + return rc; +} + +static const struct of_device_id ibm_panel_match[] = { + { .compatible = "ibm,op-panel" }, + { } +}; + +static struct i2c_driver ibm_panel_driver = { + .driver = { + .name = DEVICE_NAME, + .of_match_table = ibm_panel_match, + }, + .probe = ibm_panel_probe, + .remove = ibm_panel_remove, +}; +module_i2c_driver(ibm_panel_driver); + +MODULE_AUTHOR("Eddie James "); +MODULE_DESCRIPTION("IBM Operation Panel Driver"); +MODULE_LICENSE("GPL"); From patchwork Tue Sep 8 20:00:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 293972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7A49C433E2 for ; Tue, 8 Sep 2020 20:02:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93A4C21D41 for ; Tue, 8 Sep 2020 20:02:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="AZYAF+r/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731056AbgIHUCM (ORCPT ); Tue, 8 Sep 2020 16:02:12 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51112 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730993AbgIHUCK (ORCPT ); Tue, 8 Sep 2020 16:02:10 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 088K1gjJ130525; Tue, 8 Sep 2020 16:01:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=RCWfza78E0GJe4XRsge2lB3xIYQ/dfHU4o560gh/5Fc=; b=AZYAF+r/zzFm1JuUabkiYrUhnpR0giqWm8smqe5EWvjkxFhJYCAUDTgpdT34cfcG/I6k xIUmAWyPc0ah8VLYHCjIE5lVPZaS1dQxi5atjbWm3gNYoQBY4Vq9zMwtAbkXeOJjMxmi oDH+zIAlLJo4RVAzmSwVVCKqCI4OdcoNerhQHcrSdRGxt2GziJbCi20FhSNIrxxgiHLW UpP5Q634NWO4Ak0Q+5gl39fhhq8IWKV2NmNX8H2oBYPnUGFWqE7PzUm3P6O9oHOF2Iq8 Uf4gNx7ZGV9ID0Z6hJvkKkJlg0hulQQagdLPjzt7K3VH413AvHsThfNQJ+dkYcvN0p2v Xg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 33ef12b65j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:55 -0400 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 088K1mrW131001; Tue, 8 Sep 2020 16:01:48 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 33ef12b5tc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:47 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 088JvoAh008549; Tue, 8 Sep 2020 20:01:07 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma01dal.us.ibm.com with ESMTP id 33d46mk596-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 20:01:06 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 088K15Vc43123132 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Sep 2020 20:01:05 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C7156A04D; Tue, 8 Sep 2020 20:01:05 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B45E96A047; Tue, 8 Sep 2020 20:01:04 +0000 (GMT) Received: from SHADE6A.ibmuc.com (unknown [9.163.24.203]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 8 Sep 2020 20:01:04 +0000 (GMT) From: Eddie James To: linux-input@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-i2c@vger.kernel.org, joel@jms.id.au, andrew@aj.id.au, benh@kernel.crashing.org, brendanhiggins@google.com, dmitry.torokhov@gmail.com, robh+dt@kernel.org, wsa@kernel.org, rentao.bupt@gmail.com, ryan_chen@aspeedtech.com Subject: [PATCH v2 3/5] i2c: aspeed: Mask IRQ status to relevant bits Date: Tue, 8 Sep 2020 15:00:59 -0500 Message-Id: <20200908200101.64974-4-eajames@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200908200101.64974-1-eajames@linux.ibm.com> References: <20200908200101.64974-1-eajames@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-08_09:2020-09-08,2020-09-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=905 priorityscore=1501 impostorscore=0 mlxscore=0 suspectscore=1 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009080179 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Mask the IRQ status to only the bits that the driver checks. This prevents excessive driver warnings when operating in slave mode when additional bits are set that the driver doesn't handle. Signed-off-by: Eddie James --- drivers/i2c/busses/i2c-aspeed.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c index 31268074c422..2a388911038a 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -69,6 +69,7 @@ * These share bit definitions, so use the same values for the enable & * status bits. */ +#define ASPEED_I2CD_INTR_ALL 0xf000ffff #define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT BIT(14) #define ASPEED_I2CD_INTR_BUS_RECOVER_DONE BIT(13) #define ASPEED_I2CD_INTR_SLAVE_MATCH BIT(7) @@ -604,6 +605,7 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id) writel(irq_received & ~ASPEED_I2CD_INTR_RX_DONE, bus->base + ASPEED_I2C_INTR_STS_REG); readl(bus->base + ASPEED_I2C_INTR_STS_REG); + irq_received &= ASPEED_I2CD_INTR_ALL; irq_remaining = irq_received; #if IS_ENABLED(CONFIG_I2C_SLAVE) From patchwork Tue Sep 8 20:01:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 293974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09C6DC2BC11 for ; Tue, 8 Sep 2020 20:01:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACAFC21D24 for ; Tue, 8 Sep 2020 20:01:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="RDbjjPhL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732613AbgIHUB1 (ORCPT ); Tue, 8 Sep 2020 16:01:27 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:17362 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730980AbgIHUBZ (ORCPT ); Tue, 8 Sep 2020 16:01:25 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 088JXY5t009959; Tue, 8 Sep 2020 16:01:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=SqjvAXXx1fPCQt7yw5ZJIgr9oRhHRTjfK5p05tTBMP0=; b=RDbjjPhLLwC9eXoCvyux9nX+BnsYQ1DxjByN8czXaf9ck02yegvR25NvPiFyypg+Em5e ldzlu5qu3cqslOCoKePiuc0U/2GoUgMPrqQkH6g35J4iuicqrCFLRLdD15f5IlEqFqJv e7AeLauecjKYCJMGy8POd2DH0lHYhOn7yYivtdssA9m/fYf5veEc8R/Y6u1RSW3ODuN/ ED7mKLDGXfhK7w/yZskgjJjoY6gm/sbjfuEY/IsTii/ynIP7jGyWmdKNiuV5/VHELKqy arOZQkWID/W5ZAq0Jx6kAvQvDoR/ZIw+zUJdHbXdr3HY24Hvuhphzs+kHKI89MWlvZJK cg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33eg3frsya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:09 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 088JsYoY150161; Tue, 8 Sep 2020 16:01:08 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 33eg3frsxn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:08 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 088Jw70h029289; Tue, 8 Sep 2020 20:01:07 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma04dal.us.ibm.com with ESMTP id 33c2a989am-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 20:01:07 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 088K12fr30933464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Sep 2020 20:01:02 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 346DF6A05F; Tue, 8 Sep 2020 20:01:06 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7D86F6A047; Tue, 8 Sep 2020 20:01:05 +0000 (GMT) Received: from SHADE6A.ibmuc.com (unknown [9.163.24.203]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 8 Sep 2020 20:01:05 +0000 (GMT) From: Eddie James To: linux-input@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-i2c@vger.kernel.org, joel@jms.id.au, andrew@aj.id.au, benh@kernel.crashing.org, brendanhiggins@google.com, dmitry.torokhov@gmail.com, robh+dt@kernel.org, wsa@kernel.org, rentao.bupt@gmail.com, ryan_chen@aspeedtech.com Subject: [PATCH v2 4/5] ARM: dts: Aspeed: Tacoma: Add IBM Operation Panel I2C device Date: Tue, 8 Sep 2020 15:01:00 -0500 Message-Id: <20200908200101.64974-5-eajames@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200908200101.64974-1-eajames@linux.ibm.com> References: <20200908200101.64974-1-eajames@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-08_09:2020-09-08,2020-09-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009080179 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Set I2C bus 0 to multi-master mode and add the panel device that will register as a slave. Signed-off-by: Eddie James Reviewed-by: Joel Stanley --- arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts b/arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts index 5f4ee67ac787..4d070d6ba09f 100644 --- a/arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts +++ b/arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts @@ -4,6 +4,7 @@ #include "aspeed-g6.dtsi" #include +#include #include / { @@ -438,7 +439,13 @@ aliases { }; &i2c0 { + multi-master; status = "okay"; + + ibm-panel@62 { + compatible = "ibm,op-panel"; + reg = <(0x62 | I2C_OWN_SLAVE_ADDRESS)>; + }; }; &i2c1 { From patchwork Tue Sep 8 20:01:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 255004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F0E4C43461 for ; Tue, 8 Sep 2020 20:02:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 383FE2137B for ; Tue, 8 Sep 2020 20:02:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Yo78C4zu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732633AbgIHUB6 (ORCPT ); Tue, 8 Sep 2020 16:01:58 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48198 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731056AbgIHUBY (ORCPT ); Tue, 8 Sep 2020 16:01:24 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 088JX43j163467; Tue, 8 Sep 2020 16:01:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=d9Z1A13gqnSeYufwW0KlPFsz/dAJdIaf05kQSmmHkvM=; b=Yo78C4zudiuhvxoUXGy9UdPzzfIm6j0hOwPb9PzahM/kFLBuEur4BdepaObbe0snT5jS lky05g/flN4kpfIBqTDfYkuwUs7pLohXUP6GPda6sqKRQBtInfmbRELPZediGu47A9LB i9oDC31h/G5DwzPks52LwEem+8xkWC2Cc8IVS18eUheYEu/5GueIVJgYLvqqK+YLv+h7 SyM6Bl26L6xXNLUS1UGC4WyZU0Kuj4KpdRrNHG3QUXeJ+qgQ0VIl9NJ/yoBCBjKlJ8Wq dZdGDpMgm4ClNSgs9gpfGGsX0J4q/X5/UfdMM+hiiCk068a+CIqB6AnbxJ0l+xe4FuvE ag== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33efqwsjr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:09 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 088JXlHc168428; Tue, 8 Sep 2020 16:01:09 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 33efqwsjqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 16:01:09 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 088JwWYF009338; Tue, 8 Sep 2020 20:01:08 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma02dal.us.ibm.com with ESMTP id 33c2a989qx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 20:01:08 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 088K17su63242502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Sep 2020 20:01:07 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 020496A04F; Tue, 8 Sep 2020 20:01:07 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 47ACE6A047; Tue, 8 Sep 2020 20:01:06 +0000 (GMT) Received: from SHADE6A.ibmuc.com (unknown [9.163.24.203]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 8 Sep 2020 20:01:06 +0000 (GMT) From: Eddie James To: linux-input@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-i2c@vger.kernel.org, joel@jms.id.au, andrew@aj.id.au, benh@kernel.crashing.org, brendanhiggins@google.com, dmitry.torokhov@gmail.com, robh+dt@kernel.org, wsa@kernel.org, rentao.bupt@gmail.com, ryan_chen@aspeedtech.com Subject: [PATCH v2 5/5] ARM: dts: Aspeed: Rainier: Add IBM Operation Panel I2C device Date: Tue, 8 Sep 2020 15:01:01 -0500 Message-Id: <20200908200101.64974-6-eajames@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200908200101.64974-1-eajames@linux.ibm.com> References: <20200908200101.64974-1-eajames@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-08_09:2020-09-08,2020-09-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 malwarescore=0 spamscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009080179 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Set I2C bus 7 to multi-master mode and add the panel device that will register as a slave. Signed-off-by: Eddie James Reviewed-by: Joel Stanley --- arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts b/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts index b94421f6cbd5..50d528444f5d 100644 --- a/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +++ b/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts @@ -4,6 +4,7 @@ #include "aspeed-g6.dtsi" #include +#include #include / { @@ -698,6 +699,7 @@ eeprom@53 { }; &i2c7 { + multi-master; status = "okay"; si7021-a20@20 { @@ -831,6 +833,11 @@ gpio@15 { }; }; + ibm-panel@62 { + compatible = "ibm,op-panel"; + reg = <(0x62 | I2C_OWN_SLAVE_ADDRESS)>; + }; + dps: dps310@76 { compatible = "infineon,dps310"; reg = <0x76>;