From patchwork Fri Feb 14 11:49:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 865202 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6925525A623; Fri, 14 Feb 2025 11:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533821; cv=none; b=r+yq3XLskUQL0JQHF/65BlX1YUVuOCcmFDo44rz2XrUO3DHZypXTHBh+jlq8C1s+hKnCcAeqm9kNbZ4XdQV0aUP5PWIcec4cAUZLLhN0csqHQnrBh47G7q/UZo2zZdzgnyKmh9/8RJShdLJqPFHQS9eoABsqi9QzDML3wkfq/6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533821; c=relaxed/simple; bh=4iN68doD3fuxmdxwZZOCLGLep9xA7tPWi7Ap13zkwBA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EVOZyJktrZ4Xu+JFzVQkLTPrU1HJM1BAKQLF2bsPEzqy/7B4q6wuDjGBZzKSnNKcjvsS4jHbx3/2gxAzU4+RQZdBaDiUL1uvxVi+SDKCdcovVfTbPaB5V/3PywpGmX77jO7cr7EJW272Q6cXV/vT+yYn6YMvFbHkgrnW8Ev3GfY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=YA0s2APU; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="YA0s2APU" Received: by mail.gandi.net (Postfix) with ESMTPSA id 603D543315; Fri, 14 Feb 2025 11:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739533811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OdVQYpsk+S3y1cmSBqy5oKwPS+bnRUAOfytj1CpgdKA=; b=YA0s2APUsrSChhVJ0dtfkDKxt8MsP+Ta4WYrKiChOeV90qon9vr2bCP9jZbqvkE5XkMmFJ eItEBvqc3Q91dVnxvmeGAF6YmMtnHMUDuTsxTDLia7PjgoPTrRjow16xKvR0FLgOh/xjwl ynO2Yg5Gr65JuLOvTzpqNW+HuUUHuHqH6Tyv9xLWKAsqctGvPNWWwqgUVtBOlYXzIVowxc c+5RFW4SuKlYTIuDYkM2IKR78VnXPUTxsQIBw2vH0P63z0czna/L3dmhMyjX8yP3q+kXol AWzM14wqVncUzZWnCF4H9XbuoSTrOcLazBcbfmig2dt69CR3vPwfvvLhZ+UWpg== From: Mathieu Dubois-Briand Date: Fri, 14 Feb 2025 12:49:51 +0100 Subject: [PATCH v4 01/10] dt-bindings: mfd: gpio: Add MAX7360 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250214-mdb-max7360-support-v4-1-8a35c6dbb966@bootlin.com> References: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> In-Reply-To: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kamel Bouhara , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Michael Walle , Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, andriy.shevchenko@intel.com, =?utf-8?q?Gr=C3=A9?= =?utf-8?q?gory_Clement?= , Thomas Petazzoni , Mathieu Dubois-Briand X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1739533806; l=6853; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=4iN68doD3fuxmdxwZZOCLGLep9xA7tPWi7Ap13zkwBA=; b=MiqBcqTYxprBR3aTieH/Hn5c56g2HISIhRM1q8vJjhnXpakA/pVZxNgycSTwv00Z5Wf51QOg4 Vn4Kn1rZmj6AqS0OwsAs152iOEIjrcJ3xqe0/UY3GWeWNYzxF7f/ypo X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegleehjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeforghthhhivghuucffuhgsohhishdquehrihgrnhguuceomhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepheejtdfffeegfeelleektedvgefgteegtdejtedutdevteegtdeileefgfdviefhnecuffhomhgrihhnpeguvghvihgtvghtrhgvvgdrohhrghdprghnrghlohhgrdgtohhmnecukfhppedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejiedphhgvlhhopegluddvjedrtddruddrudgnpdhmrghilhhfrhhomhepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdefpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpt hhtohepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomhdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopegurghkrheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhmpdhrtghpthhtohepsghrghhlsegsghguvghvrdhplhdprhgtphhtthhopehlihhnuhigqdhgphhiohesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-GND-Sasl: mathieu.dubois-briand@bootlin.com Add device tree bindings for Maxim Integrated MAX7360 device with support for keypad, rotary, gpios and pwm functionalities. Signed-off-by: Mathieu Dubois-Briand --- .../bindings/gpio/maxim,max7360-gpio.yaml | 91 ++++++++++++++ .../devicetree/bindings/mfd/maxim,max7360.yaml | 139 +++++++++++++++++++++ 2 files changed, 230 insertions(+) diff --git a/Documentation/devicetree/bindings/gpio/maxim,max7360-gpio.yaml b/Documentation/devicetree/bindings/gpio/maxim,max7360-gpio.yaml new file mode 100644 index 000000000000..bdaed7917051 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/maxim,max7360-gpio.yaml @@ -0,0 +1,91 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/maxim,max7360-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim MAX7360 GPIO controller + +maintainers: + - Kamel Bouhara + - Mathieu Dubois-Briand + +description: | + Maxim MAX7360 GPIO controller, in MAX7360 chipset + https://www.analog.com/en/products/max7360.html + + The device provide two series of GPIOs, referred here as GPIOs and GPOs. + + PORT0 to PORT7 pins can be used as GPIOs, with support for interrupts and + constant-current mode. These pins will also be used by the torary encoder and + PWM functionalities. + + COL2 to COL7 pins can be used as GPOs, there is no input capability. COL pins + will be partitionned, with the first pins being affected to the keypad + functionality and the last ones as GPOs. This partioning must be described + here using the ngpios property. + +properties: + compatible: + enum: + - maxim,max7360-gpio + - maxim,max7360-gpo + + gpio-controller: true + + "#gpio-cells": + const: 2 + + ngpios: + minimum: 0 + maximum: 6 + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + + maxim,constant-current-disable: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Bit field, each bit disables constant-current output of the associated + GPIO, starting from the least significant bit for the first GPIO. + maximum: 0xff + +required: + - compatible + - gpio-controller + +allOf: + - if: + properties: + compatible: + contains: + enum: + - maxim,max7360-gpio + ngpios: false + then: + required: + - interrupt-controller + else: + properties: + interrupt-controller: false + maxim,constant-current-disable: false + + required: + - ngpios + +additionalProperties: false + +examples: + - | + gpio { + compatible = "maxim,max7360-gpio"; + + gpio-controller; + #gpio-cells = <2>; + maxim,constant-current-disable = <0x06>; + + interrupt-controller; + #interrupt-cells = <2>; + }; diff --git a/Documentation/devicetree/bindings/mfd/maxim,max7360.yaml b/Documentation/devicetree/bindings/mfd/maxim,max7360.yaml new file mode 100644 index 000000000000..4b93a3dd8ae4 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/maxim,max7360.yaml @@ -0,0 +1,139 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/maxim,max7360.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim MAX7360 Keypad, Rotary encoder, PWM and GPIO controller + +maintainers: + - Kamel Bouhara + - Mathieu Dubois-Briand + +description: | + Maxim MAX7360 device, with following functions: + - keypad controller + - rotary controller + - GPIO and GPO controller + - PWM controller + + https://www.analog.com/en/products/max7360.html + +allOf: + - $ref: /schemas/input/matrix-keymap.yaml# + - $ref: /schemas/input/input.yaml# + +properties: + compatible: + enum: + - maxim,max7360 + + reg: + maxItems: 1 + + interrupts: + maxItems: 2 + + interrupt-names: + items: + - const: inti + - const: intk + + keypad-debounce-delay-ms: + description: Keypad debounce delay in ms + minimum: 9 + maximum: 40 + default: 9 + + rotary-debounce-delay-ms: + description: Rotary encoder debounce delay in ms + minimum: 0 + maximum: 15 + default: 0 + + linux,axis: + description: The input subsystem axis to map to this rotary encoder. + + "#pwm-cells": + const: 3 + + gpio: + $ref: /schemas/gpio/maxim,max7360-gpio.yaml# + description: + PORT0 to PORT7 general purpose input/output pins configuration. + + gpo: + $ref: /schemas/gpio/maxim,max7360-gpio.yaml# + description: + COL2 to COL7 general purpose output pins configuration. + Allows to use unused keypad columns as outputs. + The MAX7360 has 8 column lines and 6 of them can be used as GPOs. Value + of ngpios must be coherent with the value of keypad,num-columns, as their + sum must not exceed the number of physical lines. + +required: + - compatible + - reg + - interrupts + - interrupt-names + - linux,keymap + - linux,axis + - "#pwm-cells" + - gpio + - gpo + +unevaluatedProperties: false + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + io-expander@38 { + compatible = "maxim,max7360"; + reg = <0x38>; + + interrupt-parent = <&gpio1>; + interrupts = <23 IRQ_TYPE_LEVEL_LOW>, + <24 IRQ_TYPE_LEVEL_LOW>; + interrupt-names = "inti", "intk"; + + keypad,num-rows = <8>; + keypad,num-columns = <4>; + linux,keymap = < + MATRIX_KEY(0x00, 0x00, KEY_F5) + MATRIX_KEY(0x01, 0x00, KEY_F4) + MATRIX_KEY(0x02, 0x01, KEY_F6) + >; + keypad-debounce-delay-ms = <10>; + autorepeat; + + rotary-debounce-delay-ms = <2>; + linux,axis = <0>; /* REL_X */ + + #pwm-cells = <3>; + + max7360_gpio: gpio { + compatible = "maxim,max7360-gpio"; + + gpio-controller; + #gpio-cells = <2>; + maxim,constant-current-disable = <0x06>; + + interrupt-controller; + #interrupt-cells = <0x2>; + }; + + max7360_gpo: gpo { + compatible = "maxim,max7360-gpo"; + + gpio-controller; + #gpio-cells = <2>; + ngpios = <4>; + }; + }; + }; From patchwork Fri Feb 14 11:49:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 865201 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A3B3263C64; Fri, 14 Feb 2025 11:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533822; cv=none; b=A1paWREWbC5uLRyMtEIdKHBE0ew1Gx3C44j5Cwxom6x6J+HtIeln1ziNg+MMSua+FsWkbrVrvOBImwEM4bsT+9mIdGVytqU+OxpH4EcSEQcj4zVObjaJRbR+1GoEoRoCUoUFlW4k/uDFWDUsvFTvKG0AGZ71cj2YsCzAj+z7ghY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533822; c=relaxed/simple; bh=cM8GtLZ+bLNxWZhWtRWMTgHK+nu3k2+SE/685tamwdA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PMUD3+wkyFW02tEv+y4iXGEHGMR3eKYikGJ5rfZDQUl2zyUB73s3UQb3GCM9WcbT7vLFoROLykrPNZ7W8PoTQO1Hc04jgl6KEqdKNMtAvnhhcUgTUJa7AIO/5mvJcPBlFg8pmrV3HtQPMM+K0YC3NP+WN2/C7L966gcKYTfpWvo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=LqYFCJGj; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="LqYFCJGj" Received: by mail.gandi.net (Postfix) with ESMTPSA id 629AD4429B; Fri, 14 Feb 2025 11:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739533812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q6dN52st5BOuW/1TAQeF1FVppaZge03iCWeKGuavnsY=; b=LqYFCJGjWSUikCbXdJIMbogCscRV3XKsQq0VH8eFqTgyPpiQajFFe/cT5ZLQ5Bwd0aRIgv kfq0adqMcRuHAZ1erhu5HD9OWaR3QUCreJ78eXBbOffOKEJ9uV2uCgVb2zeaN/8JvlnmAG af73+tZskRpJCC30VKkLBtOZUMSu2IY2vAJAXEy6OJL4owaiG5Ym359NCm2YhNCFenU2aW dQvGBFe2S0TC44ZUlzGXjbIIRJa7Yt2WWoR8aGLdwwEZIqKQGWqoCx+LzdmnTtfaHH0bd/ 2Il5lzQtMMQRMA3jd3eqdf61UQ7vB+Nz1tzlW2L069NKISZfGhO3jYWqOLZofQ== From: mathieu.dubois-briand@bootlin.com Date: Fri, 14 Feb 2025 12:49:52 +0100 Subject: [PATCH v4 02/10] mfd: Add max7360 support Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250214-mdb-max7360-support-v4-2-8a35c6dbb966@bootlin.com> References: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> In-Reply-To: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kamel Bouhara , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Michael Walle , Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, andriy.shevchenko@intel.com, =?utf-8?q?Gr=C3=A9?= =?utf-8?q?gory_Clement?= , Thomas Petazzoni , Mathieu Dubois-Briand X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1739533806; l=11127; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=eGMCWid0yMZTgPOBVWirLnrWY5N03FatifPs65pXIts=; b=qSSZJbN+EQIdnJ/qbC+KKVS/y+y1rmDCBNL7drRv2hQRVX87/KrqfCly+kfn6Qrywpw47GIj9 LOb7A0Gl0YWBaKUTy5LvfPepQMkLIUyBx9r3aLTcl8EUIdakP+OWyAQ X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegleehjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpehmrghthhhivghurdguuhgsohhishdqsghrihgrnhgusegsohhothhlihhnrdgtohhmnecuggftrfgrthhtvghrnhepveehffetteetffeftedvleeltddttdfhvefhgfelheefvdevudduhfehudfgleegnecukfhppedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejiedphhgvlhhopegluddvjedrtddruddrudgnpdhmrghilhhfrhhomhepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdefpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomhdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlr dhorhhgpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopegurghkrheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhmpdhrtghpthhtohepsghrghhlsegsghguvghvrdhplhdprhgtphhtthhopehlihhnuhigqdhgphhiohesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-GND-Sasl: mathieu.dubois-briand@bootlin.com From: Kamel Bouhara Add core driver to support MAX7360 i2c chip, multi function device with keypad, gpio, pwm, gpo and rotary encoder submodules. Signed-off-by: Kamel Bouhara Co-developed-by: Mathieu Dubois-Briand Signed-off-by: Mathieu Dubois-Briand --- drivers/mfd/Kconfig | 14 +++ drivers/mfd/Makefile | 1 + drivers/mfd/max7360.c | 218 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/mfd/max7360.h | 112 +++++++++++++++++++++++ 4 files changed, 345 insertions(+) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 6b0682af6e32..ef02a1c4322c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -2439,5 +2439,19 @@ config MFD_UPBOARD_FPGA To compile this driver as a module, choose M here: the module will be called upboard-fpga. +config MFD_MAX7360 + tristate "Maxim MAX7360 I2C IO Expander" + depends on I2C + select MFD_CORE + select REGMAP_I2C + select REGMAP_IRQ + help + Say yes here to add support for Maxim MAX7360 device, embedding + keypad, rotary encoder, PWM and GPIO features. + + This driver provides common support for accessing the device; + additional drivers must be enabled in order to use the functionality + of the device. + endmenu endif diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 9220eaf7cf12..db2bd232c150 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -163,6 +163,7 @@ obj-$(CONFIG_MFD_DA9063) += da9063.o obj-$(CONFIG_MFD_DA9150) += da9150-core.o obj-$(CONFIG_MFD_MAX14577) += max14577.o +obj-$(CONFIG_MFD_MAX7360) += max7360.o obj-$(CONFIG_MFD_MAX77541) += max77541.o obj-$(CONFIG_MFD_MAX77620) += max77620.o obj-$(CONFIG_MFD_MAX77650) += max77650.o diff --git a/drivers/mfd/max7360.c b/drivers/mfd/max7360.c new file mode 100644 index 000000000000..04ff8f5c811b --- /dev/null +++ b/drivers/mfd/max7360.c @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Maxim MAX7360 Core Driver + * + * Copyright (C) 2024 Kamel Bouhara + * Author: Kamel Bouhara + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static DEFINE_SPINLOCK(request_lock); + +struct max7360 { + struct device *dev; + struct regmap *regmap; + unsigned int requested_ports; +}; + +static const struct mfd_cell max7360_cells[] = { + { + .name = "max7360-pwm", + }, + { + .name = "max7360-gpo", + .of_compatible = "maxim,max7360-gpo", + }, + { + .name = "max7360-gpio", + .of_compatible = "maxim,max7360-gpio", + }, + { + .name = "max7360-keypad", + }, + { + .name = "max7360-rotary", + }, +}; + +static const struct regmap_range max7360_volatile_ranges[] = { + { + .range_min = MAX7360_REG_KEYFIFO, + .range_max = MAX7360_REG_KEYFIFO, + }, { + .range_min = 0x48, + .range_max = 0x4a, + }, +}; + +static const struct regmap_access_table max7360_volatile_table = { + .yes_ranges = max7360_volatile_ranges, + .n_yes_ranges = ARRAY_SIZE(max7360_volatile_ranges), +}; + +static const struct regmap_config max7360_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .max_register = 0xff, + .volatile_table = &max7360_volatile_table, + .cache_type = REGCACHE_MAPLE, +}; + +int max7360_port_pin_request(struct device *dev, unsigned int pin, bool request) +{ + struct i2c_client *client; + struct max7360 *max7360; + unsigned long flags; + int ret = 0; + + client = to_i2c_client(dev); + max7360 = i2c_get_clientdata(client); + + spin_lock_irqsave(&request_lock, flags); + if (request) { + if (max7360->requested_ports & BIT(pin)) + ret = -EBUSY; + else + max7360->requested_ports |= BIT(pin); + } else { + max7360->requested_ports &= ~BIT(pin); + } + spin_unlock_irqrestore(&request_lock, flags); + + return ret; +} +EXPORT_SYMBOL_GPL(max7360_port_pin_request); + +static int max7360_mask_irqs(struct max7360 *max7360) +{ + unsigned int val; + int ret; + + /* + * GPIO/PWM interrupts are not masked on reset: mask the during probe, + * avoiding repeated spurious interrupts if the corresponding drivers + * are not present. + */ + for (int i = 0; i < MAX7360_PORT_PWM_COUNT; i++) { + ret = regmap_write_bits(max7360->regmap, MAX7360_REG_PWMCFG(i), + MAX7360_PORT_CFG_INTERRUPT_MASK, + MAX7360_PORT_CFG_INTERRUPT_MASK); + if (ret) { + dev_err(max7360->dev, "Failed to write max7360 port configuration"); + return ret; + } + } + + /* Read GPIO in register, to ACK any pending IRQ. */ + ret = regmap_read(max7360->regmap, MAX7360_REG_GPIOIN, &val); + if (ret) { + dev_err(max7360->dev, "Failed to read gpio values: %d\n", ret); + return ret; + } + + return 0; +} + +static int max7360_reset(struct max7360 *max7360) +{ + int err; + + err = regmap_write(max7360->regmap, MAX7360_REG_GPIOCFG, + MAX7360_GPIO_CFG_GPIO_RST); + if (err) { + dev_err(max7360->dev, "Failed to reset GPIO configuration: %x\n", err); + return err; + } + + err = regcache_drop_region(max7360->regmap, MAX7360_REG_GPIOCFG, + MAX7360_REG_GPIO_LAST); + if (err) { + dev_err(max7360->dev, "Failed to drop regmap cache: %x\n", err); + return err; + } + + err = regmap_write(max7360->regmap, MAX7360_REG_SLEEP, 0); + if (err) { + dev_err(max7360->dev, "Failed to reset autosleep configuration: %x\n", err); + return err; + } + + err = regmap_write(max7360->regmap, MAX7360_REG_DEBOUNCE, 0); + if (err) { + dev_err(max7360->dev, "Failed to reset GPO port count: %x\n", err); + return err; + } + + return 0; +} + +static int max7360_probe(struct i2c_client *client) +{ + struct device *dev = &client->dev; + struct regmap *regmap; + struct max7360 *max7360; + int err; + + regmap = devm_regmap_init_i2c(client, &max7360_regmap_config); + if (IS_ERR(regmap)) + return dev_err_probe(dev, PTR_ERR(regmap), + "Failed to initialise regmap\n"); + + max7360 = devm_kzalloc(dev, sizeof(*max7360), GFP_KERNEL); + if (!max7360) + return -ENOMEM; + + max7360->regmap = regmap; + max7360->dev = dev; + i2c_set_clientdata(client, max7360); + + err = max7360_reset(max7360); + if (err) + return dev_err_probe(dev, err, "Failed to reset device\n"); + + /* Get the device out of shutdown mode. */ + err = regmap_write_bits(regmap, MAX7360_REG_GPIOCFG, + MAX7360_GPIO_CFG_GPIO_EN, + MAX7360_GPIO_CFG_GPIO_EN); + if (err) + return dev_err_probe(dev, err, "Failed to enable GPIO and PWM module\n"); + + err = max7360_mask_irqs(max7360); + if (err) + return dev_err_probe(dev, err, "Could not mask interrupts\n"); + + err = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, + max7360_cells, ARRAY_SIZE(max7360_cells), + NULL, 0, NULL); + if (err) + return dev_err_probe(dev, err, "Failed to register child devices\n"); + + return 0; +} + +static const struct of_device_id max7360_dt_match[] = { + { .compatible = "maxim,max7360" }, + {}, +}; +MODULE_DEVICE_TABLE(of, max7360_dt_match); + +static struct i2c_driver max7360_driver = { + .driver = { + .name = "max7360", + .of_match_table = max7360_dt_match, + }, + .probe = max7360_probe, +}; +module_i2c_driver(max7360_driver); + +MODULE_DESCRIPTION("Maxim MAX7360 I2C IO Expander core driver"); +MODULE_AUTHOR("Kamel Bouhara "); +MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/max7360.h b/include/linux/mfd/max7360.h new file mode 100644 index 000000000000..6beff7405d10 --- /dev/null +++ b/include/linux/mfd/max7360.h @@ -0,0 +1,112 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __LINUX_MFD_MAX7360_H +#define __LINUX_MFD_MAX7360_H + +#include +#include + +#define MAX7360_MAX_KEY_ROWS 8 +#define MAX7360_MAX_KEY_COLS 8 +#define MAX7360_MAX_KEY_NUM (MAX7360_MAX_KEY_ROWS * MAX7360_MAX_KEY_COLS) +#define MAX7360_ROW_SHIFT 3 + +#define MAX7360_MAX_GPIO 8 +#define MAX7360_MAX_GPO 6 +#define MAX7360_PORT_PWM_COUNT 8 +#define MAX7360_PORT_RTR_PIN (MAX7360_PORT_PWM_COUNT - 1) + +/* + * MAX7360 registers + */ +#define MAX7360_REG_KEYFIFO 0x00 +#define MAX7360_REG_CONFIG 0x01 +#define MAX7360_REG_DEBOUNCE 0x02 +#define MAX7360_REG_INTERRUPT 0x03 +#define MAX7360_REG_PORTS 0x04 +#define MAX7360_REG_KEYREP 0x05 +#define MAX7360_REG_SLEEP 0x06 + +/* + * MAX7360 GPIO registers + * + * All these registers are reset together when writing bit 3 of + * MAX7360_REG_GPIOCFG. + */ +#define MAX7360_REG_GPIOCFG 0x40 +#define MAX7360_REG_GPIOCTRL 0x41 +#define MAX7360_REG_GPIODEB 0x42 +#define MAX7360_REG_GPIOCURR 0x43 +#define MAX7360_REG_GPIOOUTM 0x44 +#define MAX7360_REG_PWMCOM 0x45 +#define MAX7360_REG_RTRCFG 0x46 +#define MAX7360_REG_GPIOIN 0x49 +#define MAX7360_REG_RTR_CNT 0x4A +#define MAX7360_REG_PWMBASE 0x50 +#define MAX7360_REG_PWMCFGBASE 0x58 + +#define MAX7360_REG_GPIO_LAST 0x5F + +#define MAX7360_REG_PWM(x) (MAX7360_REG_PWMBASE + (x)) +#define MAX7360_REG_PWMCFG(x) (MAX7360_REG_PWMCFGBASE + (x)) + +/* + * Configuration register bits + */ +#define MAX7360_FIFO_EMPTY 0x3f +#define MAX7360_FIFO_OVERFLOW 0x7f +#define MAX7360_FIFO_RELEASE BIT(6) +#define MAX7360_FIFO_COL GENMASK(5, 3) +#define MAX7360_FIFO_ROW GENMASK(2, 0) + +#define MAX7360_CFG_SLEEP BIT(7) +#define MAX7360_CFG_INTERRUPT BIT(5) +#define MAX7360_CFG_KEY_RELEASE BIT(3) +#define MAX7360_CFG_WAKEUP BIT(1) +#define MAX7360_CFG_TIMEOUT BIT(0) + +#define MAX7360_DEBOUNCE GENMASK(4, 0) +#define MAX7360_DEBOUNCE_MIN 9 +#define MAX7360_DEBOUNCE_MAX 40 +#define MAX7360_PORTS GENMASK(8, 5) + +#define MAX7360_INTERRUPT_TIME_MASK GENMASK(4, 0) +#define MAX7360_INTERRUPT_FIFO_MASK GENMASK(7, 5) + +#define MAX7360_PORT_CFG_INTERRUPT_MASK BIT(7) +#define MAX7360_PORT_CFG_INTERRUPT_EDGES BIT(6) + +#define MAX7360_REG_GPIOCURR_FIXED 0xC0 + +/* + * Autosleep register values (ms) + */ +#define MAX7360_AUTOSLEEP_8192 0x01 +#define MAX7360_AUTOSLEEP_4096 0x02 +#define MAX7360_AUTOSLEEP_2048 0x03 +#define MAX7360_AUTOSLEEP_1024 0x04 +#define MAX7360_AUTOSLEEP_512 0x05 +#define MAX7360_AUTOSLEEP_256 0x06 + +#define MAX7360_GPIO_CFG_RTR_EN BIT(7) +#define MAX7360_GPIO_CFG_GPIO_EN BIT(4) +#define MAX7360_GPIO_CFG_GPIO_RST BIT(3) + +#define MAX7360_ROT_DEBOUNCE GENMASK(3, 0) +#define MAX7360_ROT_DEBOUNCE_MIN 0 +#define MAX7360_ROT_DEBOUNCE_MAX 15 +#define MAX7360_ROT_INTCNT GENMASK(6, 4) +#define MAX7360_ROT_INTCNT_DLY BIT(7) + +#define MAX7360_INT_INTI 0 +#define MAX7360_INT_INTK 1 + +#define MAX7360_INT_GPIO 0 +#define MAX7360_INT_KEYPAD 1 +#define MAX7360_INT_ROTARY 2 + +#define MAX7360_NR_INTERNAL_IRQS 3 + +int max7360_port_pin_request(struct device *dev, unsigned int pin, bool request); + +#endif From patchwork Fri Feb 14 11:49:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 865199 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A99B263F2C; Fri, 14 Feb 2025 11:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533825; cv=none; b=rEORddKVbdTDx93FcCQd1qca88Fvga+KMTcgvtZLk1QfTfkWlSZC+1ICS+lOGr9zuPK70RORmjmZ91ctTZP6HpKUNZab2bCDssZTpvWnxTEpQxA2A1VfGPtanb8WIkoPu5RsjJfjfm6+hZTzMmNCb7zmLNAnkdNIM2wzfc9D6qo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533825; c=relaxed/simple; bh=t/EuLZQlpOe/LmOn/GZ77df/7tGyTGkWiw9+9XzVGCU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qGek3ueVCCqStY1ij5txNQBOcXrkCtLALIkx7hkV89n+JPJPXMuCOksQ+ULcqEIBD7qmjSLahOsihYu+Jwk8Zh2brHdgxUMSC6APxqZHN81pkwL7iT+gJMDmKEfDuPEDCBFf+Ub3UL9iQjxW17T4C1Et1GJk6Vhe8uaClDk2D0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=kWwxQrjT; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="kWwxQrjT" Received: by mail.gandi.net (Postfix) with ESMTPSA id 7E95D44299; Fri, 14 Feb 2025 11:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739533813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zhAfL6p2Tu5CbkRFq/4tIEg0OmDK9rfhbiyVWYECfuM=; b=kWwxQrjTkeU8P8uyg2zVtlWcs1TVhdU1FzA5WaIufSWq1oVFDjdYAsE0apwQvraHqz5wts wbTxCfLkpH/oCKPmLftQH4yRpSQS7lWcF9SOxf8PhYLJMsqHtZQhpcyG41/PP8Cq0cu/V3 d1vWzWu4oYDMv05AC4CMXb74VLUT6nSU99I66PIVD3vn9519T8HEUAw6M3gv1OCKIhZRQH 4lD68av5+UOfMfQsqNYtcfS9pddcdIbgtjuj12sz7NHgkZH/00Z4CnpTatx6JCp9MMJd2W LKiOiRem58N2ks/fYQtNxgJ5XJnZwMWH5gLSfpKMQQthjVhPtcgXDz/WmMS+6Q== From: mathieu.dubois-briand@bootlin.com Date: Fri, 14 Feb 2025 12:49:53 +0100 Subject: [PATCH v4 03/10] pwm: max7360: Add MAX7360 PWM support Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250214-mdb-max7360-support-v4-3-8a35c6dbb966@bootlin.com> References: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> In-Reply-To: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kamel Bouhara , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Michael Walle , Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, andriy.shevchenko@intel.com, =?utf-8?q?Gr=C3=A9?= =?utf-8?q?gory_Clement?= , Thomas Petazzoni , Mathieu Dubois-Briand X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1739533806; l=7974; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=CxMsleng0cZ3BeZymcuuErbxiPnn4kKb8ceRlh9SgXg=; b=Xf0beUWgYo9vw+zVjpW9nw5AzwSlbfq7WymEaxfdXlfS9/YO42oRReLTA62OxjSOzw36JU7W/ 4p9p03wKfBWAx2klJz8/khdfvwl4odUMreQ8DuokEv6yWBLflI5htJv X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegleehjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpehmrghthhhivghurdguuhgsohhishdqsghrihgrnhgusegsohhothhlihhnrdgtohhmnecuggftrfgrthhtvghrnhepveehffetteetffeftedvleeltddttdfhvefhgfelheefvdevudduhfehudfgleegnecukfhppedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejiedphhgvlhhopegluddvjedrtddruddrudgnpdhmrghilhhfrhhomhepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdefpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomhdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlr dhorhhgpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopegurghkrheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhmpdhrtghpthhtohepsghrghhlsegsghguvghvrdhplhdprhgtphhtthhopehlihhnuhigqdhgphhiohesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-GND-Sasl: mathieu.dubois-briand@bootlin.com From: Kamel Bouhara Add driver for Maxim Integrated MAX7360 PWM controller, supporting up to 8 independent PWM outputs. Signed-off-by: Kamel Bouhara Co-developed-by: Mathieu Dubois-Briand Signed-off-by: Mathieu Dubois-Briand --- drivers/pwm/Kconfig | 10 +++ drivers/pwm/Makefile | 1 + drivers/pwm/pwm-max7360.c | 213 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+) diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 0915c1e7df16..fac811ee46b5 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -745,4 +745,14 @@ config PWM_XILINX To compile this driver as a module, choose M here: the module will be called pwm-xilinx. +config PWM_MAX7360 + tristate "MAX7360 PWMs" + depends on MFD_MAX7360 + help + PWM driver for Maxim Integrated MAX7360 multifunction device, with + support for up to 8 PWM outputs. + + To compile this driver as a module, choose M here: the module + will be called pwm-max7360. + endif diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index 9081e0c0e9e0..ae8908ffc892 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -36,6 +36,7 @@ obj-$(CONFIG_PWM_LPC32XX) += pwm-lpc32xx.o obj-$(CONFIG_PWM_LPSS) += pwm-lpss.o obj-$(CONFIG_PWM_LPSS_PCI) += pwm-lpss-pci.o obj-$(CONFIG_PWM_LPSS_PLATFORM) += pwm-lpss-platform.o +obj-$(CONFIG_PWM_MAX7360) += pwm-max7360.o obj-$(CONFIG_PWM_MESON) += pwm-meson.o obj-$(CONFIG_PWM_MEDIATEK) += pwm-mediatek.o obj-$(CONFIG_PWM_MICROCHIP_CORE) += pwm-microchip-core.o diff --git a/drivers/pwm/pwm-max7360.c b/drivers/pwm/pwm-max7360.c new file mode 100644 index 000000000000..f1257c20add2 --- /dev/null +++ b/drivers/pwm/pwm-max7360.c @@ -0,0 +1,213 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright 2024 Bootlin + * + * Author: Kamel BOUHARA + * Author: Mathieu Dubois-Briand + * + * Limitations: + * - Only supports normal polarity. + * - The period is fixed to 2 ms. + * - Only the duty cycle can be changed, new values are applied at the beginning + * of the next cycle. + * - When disabled, the output is put in Hi-Z. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX7360_NUM_PWMS 8 +#define MAX7360_PWM_MAX_RES 255 +#define MAX7360_PWM_PERIOD_NS 2000000 /* 500 Hz */ +#define MAX7360_PWM_COMMON_PWN BIT(5) +#define MAX7360_PWM_CTRL_ENABLE(n) BIT(n) +#define MAX7360_PWM_PORT(n) BIT(n) + +struct max7360_pwm { + struct device *parent; + struct regmap *regmap; +}; + +struct max7360_pwm_waveform { + u8 duty_steps; +}; + +static inline struct max7360_pwm *max7360_pwm_from_chip(struct pwm_chip *chip) +{ + return pwmchip_get_drvdata(chip); +} + +static int max7360_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) +{ + struct max7360_pwm *max7360_pwm; + int ret; + + max7360_pwm = max7360_pwm_from_chip(chip); + ret = max7360_port_pin_request(max7360_pwm->parent, pwm->hwpwm, true); + if (ret) { + dev_warn(&chip->dev, "failed to request pwm-%d\n", pwm->hwpwm); + return ret; + } + + ret = regmap_write_bits(max7360_pwm->regmap, + MAX7360_REG_PWMCFG(pwm->hwpwm), + MAX7360_PWM_COMMON_PWN, + 0); + if (ret) + return ret; + + return regmap_write_bits(max7360_pwm->regmap, MAX7360_REG_PORTS, + MAX7360_PWM_PORT(pwm->hwpwm), + MAX7360_PWM_PORT(pwm->hwpwm)); +} + +static void max7360_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) +{ + struct max7360_pwm *max7360_pwm; + + max7360_pwm = max7360_pwm_from_chip(chip); + max7360_port_pin_request(max7360_pwm->parent, pwm->hwpwm, false); +} + +static int max7360_pwm_round_waveform_tohw(struct pwm_chip *chip, + struct pwm_device *pwm, + const struct pwm_waveform *wf, + void *_wfhw) +{ + struct max7360_pwm_waveform *wfhw = _wfhw; + u64 duty_steps; + + /* + * Ignore user provided values for period_length_ns and duty_offset_ns: + * we only support fixed period of MAX7360_PWM_PERIOD_NS and offset of + * 0. + */ + + duty_steps = mul_u64_u64_div_u64(wf->duty_length_ns, MAX7360_PWM_MAX_RES, + MAX7360_PWM_PERIOD_NS); + + wfhw->duty_steps = min(MAX7360_PWM_MAX_RES, duty_steps); + + return 0; +} + +static int max7360_pwm_round_waveform_fromhw(struct pwm_chip *chip, struct pwm_device *pwm, + const void *_wfhw, struct pwm_waveform *wf) +{ + const struct max7360_pwm_waveform *wfhw = _wfhw; + + wf->period_length_ns = MAX7360_PWM_PERIOD_NS; + wf->duty_offset_ns = 0; + wf->duty_length_ns = DIV64_U64_ROUND_UP(wfhw->duty_steps * MAX7360_PWM_PERIOD_NS, + MAX7360_PWM_MAX_RES); + + return 0; +} + +static int max7360_pwm_write_waveform(struct pwm_chip *chip, + struct pwm_device *pwm, + const void *_wfhw) +{ + const struct max7360_pwm_waveform *wfhw = _wfhw; + struct max7360_pwm *max7360_pwm; + unsigned int val; + int ret; + + max7360_pwm = max7360_pwm_from_chip(chip); + + val = (wfhw->duty_steps == 0) ? 0 : MAX7360_PWM_CTRL_ENABLE(pwm->hwpwm); + ret = regmap_write_bits(max7360_pwm->regmap, MAX7360_REG_GPIOCTRL, + MAX7360_PWM_CTRL_ENABLE(pwm->hwpwm), val); + + if (!ret && wfhw->duty_steps != 0) { + ret = regmap_write(max7360_pwm->regmap, MAX7360_REG_PWM(pwm->hwpwm), + wfhw->duty_steps); + } + + return ret; +} + +static int max7360_pwm_read_waveform(struct pwm_chip *chip, + struct pwm_device *pwm, + void *_wfhw) +{ + struct max7360_pwm_waveform *wfhw = _wfhw; + struct max7360_pwm *max7360_pwm; + unsigned int val; + int ret; + + max7360_pwm = max7360_pwm_from_chip(chip); + + ret = regmap_read(max7360_pwm->regmap, MAX7360_REG_GPIOCTRL, &val); + if (ret) + return ret; + + if (val & MAX7360_PWM_CTRL_ENABLE(pwm->hwpwm)) { + ret = regmap_read(max7360_pwm->regmap, MAX7360_REG_PWM(pwm->hwpwm), + &val); + val = wfhw->duty_steps; + } else { + wfhw->duty_steps = 0; + } + + return ret; +} + +static const struct pwm_ops max7360_pwm_ops = { + .request = max7360_pwm_request, + .free = max7360_pwm_free, + .round_waveform_tohw = max7360_pwm_round_waveform_tohw, + .round_waveform_fromhw = max7360_pwm_round_waveform_fromhw, + .read_waveform = max7360_pwm_read_waveform, + .write_waveform = max7360_pwm_write_waveform, +}; + +static int max7360_pwm_probe(struct platform_device *pdev) +{ + struct max7360_pwm *max7360_pwm; + struct pwm_chip *chip; + int ret; + + if (!pdev->dev.parent) + return dev_err_probe(&pdev->dev, -ENODEV, "no parent device\n"); + + chip = devm_pwmchip_alloc(pdev->dev.parent, MAX7360_NUM_PWMS, + sizeof(*max7360_pwm)); + if (IS_ERR(chip)) + return PTR_ERR(chip); + chip->ops = &max7360_pwm_ops; + + max7360_pwm = max7360_pwm_from_chip(chip); + max7360_pwm->parent = pdev->dev.parent; + + max7360_pwm->regmap = dev_get_regmap(pdev->dev.parent, NULL); + if (!max7360_pwm->regmap) + return dev_err_probe(&pdev->dev, -ENODEV, + "could not get parent regmap\n"); + + ret = devm_pwmchip_add(&pdev->dev, chip); + if (ret != 0) + return dev_err_probe(&pdev->dev, ret, + "failed to add PWM chip\n"); + + return 0; +} + +static struct platform_driver max7360_pwm_driver = { + .driver = { + .name = "max7360-pwm", + }, + .probe = max7360_pwm_probe, +}; +module_platform_driver(max7360_pwm_driver); + +MODULE_DESCRIPTION("MAX7360 PWM driver"); +MODULE_AUTHOR("Kamel BOUHARA "); +MODULE_AUTHOR("Mathieu Dubois-Briand "); +MODULE_LICENSE("GPL"); From patchwork Fri Feb 14 11:49:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 865200 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AE26263F2E; Fri, 14 Feb 2025 11:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533824; cv=none; b=DJaAl0vqHO+A/RB7gVlz2qUtKOCVk8WksqHpIAa4WpBgji5Uyv/+oABB4PUlL54hwr9GWBiKk/FcK3YFNjzj3Rt1jjTqVPHdrB/VuBXRFPEsSt8TIQWnhMu1ouR51ZSU4KjFFmxP4sOZ3JjWoypa/eaI1r8RXx5HADbhDmyRINg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533824; c=relaxed/simple; bh=RACglYSaKk38UOV2H+jm6GJa3jpL0WJBtuPusm0yxSg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nlG8MNRJ7SvI9HrUB1lWK2axlLmLIN3XmXRozfuGOls+YVFOcAKbWWjZhKxpnilzzfO5f84Y58/fLzVRP8/f2xswuEoe5vps4/5YxmMdTcRMQOdBfeKcKGP/Ze4MJfrJAxVlJfz26enXVpQj7TJ2IO3gWa39Iy3fjfztsK4l8fA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=QPP1kn/O; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QPP1kn/O" Received: by mail.gandi.net (Postfix) with ESMTPSA id 97427442E0; Fri, 14 Feb 2025 11:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739533814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mOp6v2Ru6Y06CuRpAEPXOFL6ll0w0HhqmA5LgQKfTVU=; b=QPP1kn/OkSeUFxayYEB6SsGSDpzdTyUG3yO3yFj7BnNuUSqgiWF9Phl8qZD0IV6cmF6sGn fHSIhtIJkyRmOha1MQtLO8zEGAUBee9Kcc6yk5ye814Zza5dRKARr3seA+e/ypS4PkMiTZ EptJFEcBiSb8uHXq1GNtD2xSNzjEjTjWx99e40lNVnXEOoerlTLV1cPGlKxsqC2cBxA0Jv JsXmdNwg7FveYOei3rLwog0Cl1Elhzl2H4UsO+tV+U2CmeF8oSIouSWb/6jPbyqojP7+qw PKQF1gBnH4fdd8/OEEGv9ULKDohLLr6bnQc77hqXTbS6zlCPxUXFOpdj99lDJA== From: Mathieu Dubois-Briand Date: Fri, 14 Feb 2025 12:49:54 +0100 Subject: [PATCH v4 04/10] gpio: regmap: Allow to provide request and free callbacks Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250214-mdb-max7360-support-v4-4-8a35c6dbb966@bootlin.com> References: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> In-Reply-To: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kamel Bouhara , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Michael Walle , Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, andriy.shevchenko@intel.com, =?utf-8?q?Gr=C3=A9?= =?utf-8?q?gory_Clement?= , Thomas Petazzoni , Mathieu Dubois-Briand X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1739533806; l=2131; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=RACglYSaKk38UOV2H+jm6GJa3jpL0WJBtuPusm0yxSg=; b=oje7y82KnEsmMhMkE2XtUgZhcjWPi5QYw/4g0u1gfSdllShmhkXWjcw+5uJrxvsV/6ax3sixB GjL7vy3dz3uCD5aLzXB6V+kKBEc/GnP+AuMt+dJyxXzIIL3mLrC9GHG X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegleehjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeforghthhhivghuucffuhgsohhishdquehrihgrnhguuceomhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnheptdfhgeetvddvheejieehheehueetjeelkedtfeehhefgfeeglefhteegtddthfetnecukfhppedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejiedphhgvlhhopegluddvjedrtddruddrudgnpdhmrghilhhfrhhomhepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdefpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrt ghomhdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopegurghkrheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhmpdhrtghpthhtohepsghrghhlsegsghguvghvrdhplhdprhgtphhtthhopehlihhnuhigqdhgphhiohesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-GND-Sasl: mathieu.dubois-briand@bootlin.com Allows to populate the gpio_regmap_config structure with request() and free() callbacks to set on the final gpio_chip structure. Signed-off-by: Mathieu Dubois-Briand --- drivers/gpio/gpio-regmap.c | 2 ++ include/linux/gpio/regmap.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index 05f8781b5204..ba72c23bcf97 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -261,6 +261,8 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config chip->names = config->names; chip->label = config->label ?: dev_name(config->parent); chip->can_sleep = regmap_might_sleep(config->regmap); + chip->request = config->request; + chip->free = config->free; chip->request = gpiochip_generic_request; chip->free = gpiochip_generic_free; diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h index a9f7b7faf57b..16f0c33df75d 100644 --- a/include/linux/gpio/regmap.h +++ b/include/linux/gpio/regmap.h @@ -6,6 +6,7 @@ struct device; struct fwnode_handle; struct gpio_regmap; +struct gpio_chip; struct irq_domain; struct regmap; @@ -40,6 +41,10 @@ struct regmap; * @drvdata: (Optional) Pointer to driver specific data which is * not used by gpio-remap but is provided "as is" to the * driver callback(s). + * @request: (Optional) Hook for chip-specific activation, such as + * enabling module power and clock + * @free: (Optional) Hook for chip-specific deactivation, such as + * disabling module power and clock * * The ->reg_mask_xlate translates a given base address and GPIO offset to * register and mask pair. The base address is one of the given register @@ -83,6 +88,8 @@ struct gpio_regmap_config { unsigned int *mask); void *drvdata; + int (*request)(struct gpio_chip *gc, unsigned int offset); + void (*free)(struct gpio_chip *gc, unsigned int offset); }; struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config); From patchwork Fri Feb 14 11:50:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 865198 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF56E26462F; Fri, 14 Feb 2025 11:50:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533825; cv=none; b=L61Ai2nmqUQIVw3eQYjRprpzEHUsgtDskJnMOedwEdQFkWHlwQE/rKYWXf6BMJZaNfrThT+iUmUMHe0iS+tb1NKKgV9lbjkXA9IZSovt8bm2irg8JkAJvGk2RUwsqPS6ZtqX0N3/8OYagyBuaiQ6KgU0cHfZF2FGC5z7MxXPQro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739533825; c=relaxed/simple; bh=D/eIms9kiC35KWhyUeLOEVFRQllk3whI5W6tAPS54ps=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ufs5NuxNRH4qS2ib2LVTjiusHBKOqhByRowAnufCmRyIcA13iqAbwckzGxQSYJK9boZ3MqxHcK8xT5inJXA+k7dUPtUPNtniILDVqfLt7tTP51nI3mjWZLDNrq61BZGfYgxZl78yeQRfOD1vrNOfetYK+ak5SUsUdvSIwR0MM+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=iQQumOHM; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="iQQumOHM" Received: by mail.gandi.net (Postfix) with ESMTPSA id EC35B442C0; Fri, 14 Feb 2025 11:50:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739533820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KmhFstE9r58cW4sRIbJleq7fBxZv+mHOP5YHY97/3Lg=; b=iQQumOHM8h8wylM5W0LrNpmPlfFLza5iiw1Jof2W8UYFDCddBWEP1NriQQd6ZLoL+oRJ1Z xrozJooF0Ma8aNgEnoqp/bNjgK0QOB7Q3AqjpGYJYVHzjcx+E/sy/ggei7lgdmAunx53ph pIsiwdiFhjI61NBcGGyTOTpr3k/lZ+xZeOALY88LhTJKD9aCl04h9hpMAdeotuWoSdIS6B Ux0By4r/PF5uQv3p/9IGQnjISG67FkJxNJ2AebFcC6kQAZlSeuxf3iQZ5vr1f6VYgjwlSl pH6r9gDqzpDJ6XomyXN8XNxRr1I2w0YpvsKLTPUb6mktzInGk7HWSJNt9FjSZA== From: Mathieu Dubois-Briand Date: Fri, 14 Feb 2025 12:50:00 +0100 Subject: [PATCH v4 10/10] MAINTAINERS: Add entry on MAX7360 driver Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250214-mdb-max7360-support-v4-10-8a35c6dbb966@bootlin.com> References: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> In-Reply-To: <20250214-mdb-max7360-support-v4-0-8a35c6dbb966@bootlin.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kamel Bouhara , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Michael Walle , Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, andriy.shevchenko@intel.com, =?utf-8?q?Gr=C3=A9?= =?utf-8?q?gory_Clement?= , Thomas Petazzoni , Mathieu Dubois-Briand X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1739533806; l=1042; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=D/eIms9kiC35KWhyUeLOEVFRQllk3whI5W6tAPS54ps=; b=BjvuPwcQmsL5Sf8B6SZYaiHb2mS3Iic12ZFWmdR/RTDKCB2JGwSjcdWTcmfYcV6l1FqewUbOq lUMYXFjsYL0AwLvSWdOys6h4oJLrm2I9P25YLvVIBLgfNu4BOzcXpn0 X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegleehjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeforghthhhivghuucffuhgsohhishdquehrihgrnhguuceomhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnheptdfhgeetvddvheejieehheehueetjeelkedtfeehhefgfeeglefhteegtddthfetnecukfhppedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejieenucevlhhushhtvghrufhiiigvpeegnecurfgrrhgrmhepihhnvghtpedvrgdtudemtggsudegmeehheeimeejrgdttdemfehftghfmehfsgdtugemuddviedvmedvvgejiedphhgvlhhopegluddvjedrtddruddrudgnpdhmrghilhhfrhhomhepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdefpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhgrthhhihgvuhdrughusghoihhsqdgsrhhirghnugessghoohhtlhhinhdrt ghomhdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopegurghkrheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhmpdhrtghpthhtohepsghrghhlsegsghguvghvrdhplhdprhgtphhtthhopehlihhnuhigqdhgphhiohesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-GND-Sasl: mathieu.dubois-briand@bootlin.com Add myself as maintainer of Maxim MAX7360 driver and device-tree bindings. Signed-off-by: Mathieu Dubois-Briand --- MAINTAINERS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 25c86f47353d..1916b41309f0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14259,6 +14259,18 @@ L: linux-iio@vger.kernel.org S: Maintained F: drivers/iio/temperature/max30208.c +MAXIM MAX7360 KEYPAD LED MFD DRIVER +M: Mathieu Dubois-Briand +S: Maintained +F: Documentation/devicetree/bindings/gpio/maxim,max7360-gpio.yaml +F: Documentation/devicetree/bindings/mfd/maxim,max7360.yaml +F: drivers/gpio/gpio-max7360.c +F: drivers/input/keyboard/max7360-keypad.c +F: drivers/input/misc/max7360-rotary.c +F: drivers/mfd/max7360.c +F: drivers/pwm/pwm-max7360.c +F: include/linux/mfd/max7360.h + MAXIM MAX77650 PMIC MFD DRIVER M: Bartosz Golaszewski L: linux-kernel@vger.kernel.org