From patchwork Wed Aug 18 15:44:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499903 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 0A184C4338F for ; Thu, 19 Aug 2021 11:15:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFF4361100 for ; Thu, 19 Aug 2021 11:15:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238470AbhHSLQa (ORCPT ); Thu, 19 Aug 2021 07:16:30 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:54653 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238480AbhHSLQ3 (ORCPT ); Thu, 19 Aug 2021 07:16:29 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 0D182580AF6; Thu, 19 Aug 2021 07:15:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 07:15:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=DiwHj+vaHXUQK XyQ9BUo+GIG90hR4W/o3+wsmuFsT8o=; b=dUwUjS98N7+fRQC2sMrgXvPNsVPgX mZJnfsfxR4ZtNStMi0sBqoS7TjZL6l3ul0kevxXsWHvfiQeaQkwsgNFZzeM9rKP2 Y10MiNsrVWSTbubGbtpP5v+b+NjV7RBkenvV8Qpq11/vN5NM1OHpaqWKXDz2zoJT kHbnjgzdwZI4zyHrFd+f4m6Ykf90CW+cezA8r4bLepqtiMLydSsRyCeIHHiXH5/N 6tw6wZxb/MuoovaIha667scvkUnE0GQjU24+ZOlBrU/yzu4nEYfZcF+UmgkZKRvb pN7JQ21qKOC3lRPkF9AuNomUYn9AcYP1xz5mJtMoqeAwT4Xv7ZQ+iR0PQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=DiwHj+vaHXUQKXyQ9BUo+GIG90hR4W/o3+wsmuFsT8o=; b=ODNO3YSQ iDG+MWDheEwwWIGOBTUG/iLgrxe8jJrWy5zyBpDAUD0rSLIks4bVUJRXkhbBUfXB uo/B/PpScGMDHqev2YleYvpLauoPHzFsxwpVImWO9ajRYL8c9t4S9UsxeCUY6hYb qgtf9F/L+fvbWAorDef8ytKb30LI8B2ahjxX3TcEr1sLC6ZgSzMf55nl4RaLibk6 +Xl9OSX5GQvnFkRgkaxlxX2388LlpJr5RcX6wrHxVA9PfWNtE/3g0PGlhXxQTAYE A2Xg3M8pP+zXR65bNZDIBYKWi/FIUXs6hINzuhiLqSOXzEC9FaDOF7/M6EvFrwMj wzLDL1cXPyZvCw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgr ihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqe enucggtffrrghtthgvrhhnpefftdfhgfeggfelgfekjefhkeeigfelleefhfethfehfeet leeggeeggfefffdvtdenucffohhmrghinhepuggvvhhitggvthhrvggvrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:15:48 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis , Rob Herring Subject: [PATCH v11 01/10] dt-bindings: mfd: Initial commit of silergy, sy7636a.yaml Date: Thu, 19 Aug 2021 01:44:40 +1000 Message-Id: <20210818154449.1037-2-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Initial support for the Silergy SY7636A Power Management chip and regulator. Signed-off-by: Alistair Francis Reviewed-by: Rob Herring --- .../bindings/mfd/silergy,sy7636a.yaml | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml diff --git a/Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml b/Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml new file mode 100644 index 000000000000..0566f9498e2f --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/silergy,sy7636a.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: silergy sy7636a PMIC + +maintainers: + - Alistair Francis + +properties: + compatible: + const: silergy,sy7636a + + reg: + description: + I2C device address. + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + '#thermal-sensor-cells': + const: 0 + + epd-pwr-good-gpios: + description: + Specifying the power good GPIOs. + maxItems: 1 + + regulators: + type: object + + properties: + compatible: + const: silergy,sy7636a-regulator + + vcom: + type: object + $ref: /schemas/regulator/regulator.yaml# + properties: + regulator-name: + const: vcom + + additionalProperties: false + +required: + - compatible + - reg + - '#thermal-sensor-cells' + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@62 { + compatible = "silergy,sy7636a"; + reg = <0x62>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_epdpmic>; + #thermal-sensor-cells = <0>; + + regulators { + reg_epdpmic: vcom { + regulator-name = "vcom"; + regulator-boot-on; + }; + }; + }; + }; +... From patchwork Wed Aug 18 15:44:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500625 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 2BAD5C4338F for ; Thu, 19 Aug 2021 11:16:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08AA360E90 for ; Thu, 19 Aug 2021 11:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238544AbhHSLQe (ORCPT ); Thu, 19 Aug 2021 07:16:34 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:56461 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238546AbhHSLQd (ORCPT ); Thu, 19 Aug 2021 07:16:33 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id CC6995C018A; Thu, 19 Aug 2021 07:15:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 07:15:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=A2r/hYIyBwcyH JC0wUiLCZaI1cWMDK2yP1TGNmVEp74=; b=ACwNQ8LwBwmhslkMtqLWA/RJZW+3E QPoln2CMRKj6sD/T8ygBwEZ4//Aug3L+Kf2dyofJipmLBmpUIWHInqJCv27Hx74Z azRfbbEuLc6fRbvptb3IumjFv9a6a2qN253P1V3aCn43kk8ANEYWE5Vy7i8aQ+sl HAhme+qWMbDgK70wCyIZozaNOA2vI5RfLKfdkTXmiQIlC0xKI2oC+NfAj45Mz4NA GPBQw1IBk1hiov/xxhppUEnGj0YSidtZwCahpk6M5CYpt/sRR4gL9iqGkBURFQmu 36N/Yi4jCUElqXiJBaDvL2N3peSApgyK7dK00m+DIEF7VIDl3h8dtGJqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=A2r/hYIyBwcyHJC0wUiLCZaI1cWMDK2yP1TGNmVEp74=; b=cTS4E1GS S1Z9TGHi2wK/odaeYK4iM2pZeVzZVJG9QsDuoOa9D9PBJcQNUUoBiQPVuUwpL/Gr XwBbe7eggwupw+VyCcK4Ic5tm9Ese3drC6DRajs8lkWJnIeQWCMfe926AJUydWvI GjNBXKlxJ0323V657oB9ewesNkrqwnTEvY1Plxb1RFQuh17p6KGUKukLeCGivWr6 NzeR6z7KWESuJpPMX1Qs9MWNlccmKvYNU0iXbjyXm+B67AUcWa6PIGXtbc/Mp+S1 x3k9saJKreACf5YxsU/vsTFrI/prgLXKry1z0k7y9YbTtczvkd0RVLhPj8NK45sn B1tA0DGGK3pfrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:15:53 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v11 02/10] mfd: simple-mfd-i2c: Add a Kconfig name Date: Thu, 19 Aug 2021 01:44:41 +1000 Message-Id: <20210818154449.1037-3-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add a Kconfig name to the "Simple Multi-Functional Device support (I2C)" device so that it can be enabled via menuconfig. Signed-off-by: Alistair Francis --- drivers/mfd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 6a3fd2d75f96..ff95d00dc1ac 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1176,7 +1176,7 @@ config MFD_SI476X_CORE module will be called si476x-core. config MFD_SIMPLE_MFD_I2C - tristate + tristate "Simple Multi-Functional Device support (I2C)" depends on I2C select REGMAP_I2C help From patchwork Wed Aug 18 15:44:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499902 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 772E7C4338F for ; Thu, 19 Aug 2021 11:16:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E375610D2 for ; Thu, 19 Aug 2021 11:16:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238482AbhHSLQj (ORCPT ); Thu, 19 Aug 2021 07:16:39 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:33667 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238597AbhHSLQh (ORCPT ); Thu, 19 Aug 2021 07:16:37 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2FF9E5C016C; Thu, 19 Aug 2021 07:16:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 19 Aug 2021 07:16:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=Y+R86tHeDAExu pHL82StJkBXeuy0hLrNl1PAhb3tmnQ=; b=FU+CDV7GKBm1FrrFUGld0ER1VT0Ts S2LuQS0Ax7xBtrtpX31c7pwvV4pIUSFTo8oOYx67POPDG/H1Jw7U7gqn7uON4jIy oGJTIihT/fPNIAZKfJ7k5NnIWO2AkCAygDz7yMFTB7OrJUhH6pkGUrYFS+8+XEki 97Ci9GTEAOqbIAG1Wuk+uO83+xX6V7uZc/RaUG6NG8kaMTVvi4fdPlvcvDEYHjg1 fQu/uYZqpa7HM2TqVqtoyGhNk2TLguJjBtJPEgK2c5FNIiLZO6qKwBg2JZqc3N6a RJmP2DCxeZIXAib7vKrFVkgxiH/HwFrrE5GwT9C5t+WtEmCENNf0KYYhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=Y+R86tHeDAExupHL82StJkBXeuy0hLrNl1PAhb3tmnQ=; b=migdZzBl sUYcVyfFjimob5Csbv1K1E0NUv4zX/jiKrrZkkRbtUP1vpOmI9gCrLYPOHxdIzWf L56wFb6lh1g6zywAuyq+rwXN1v+iCJYyxE224IoB2Sff4WCjwr6F200copVK5+Yv 0D8Outqjqo+q2JILAjx7T9Kl9OTfTzOUPDTMtKR2eUwgObgr/Q6WXpAhduNKrcBq 2xXlox4VbUVrw64huAMHGt41w7ThrbvFawG7IEJmyClPIOgQg8bW+SzEeTTDjZpK utn+zciX15rkqoqIS1a/UhKk90xxYmFcXVGp+xuGJakRDHpPP55dB7gAQtiiPd/Y OH+Zw/b8a/nTKQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepheffjeetteetke ffhfdvgefhgeevvddvueejheehfeevfedufeegiedtheeujeelnecuffhomhgrihhnpehr vghmrghrkhgrsghlvgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:15:57 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v11 03/10] mfd: simple-mfd-i2c: Enable support for the silergy, sy7636a Date: Thu, 19 Aug 2021 01:44:42 +1000 Message-Id: <20210818154449.1037-4-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Alistair Francis Acked-for-MFD-by: Lee Jones --- drivers/mfd/simple-mfd-i2c.c | 12 +++++++++++ include/linux/mfd/sy7636a.h | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 include/linux/mfd/sy7636a.h diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c index 583e8c7924af..ce213c68b8cf 100644 --- a/drivers/mfd/simple-mfd-i2c.c +++ b/drivers/mfd/simple-mfd-i2c.c @@ -62,8 +62,20 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c) return ret; } +static const struct mfd_cell sy7636a_cells[] = { + { .name = "sy7636a-regulator", }, + { .name = "sy7636a-temperature", }, + { .name = "sy7636a-thermal", }, +}; + +static const struct simple_mfd_data silergy_sy7636a = { + .mfd_cell = sy7636a_cells, + .mfd_cell_size = ARRAY_SIZE(sy7636a_cells), +}; + static const struct of_device_id simple_mfd_i2c_of_match[] = { { .compatible = "kontron,sl28cpld" }, + { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a}, {} }; MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match); diff --git a/include/linux/mfd/sy7636a.h b/include/linux/mfd/sy7636a.h new file mode 100644 index 000000000000..15caa54f0432 --- /dev/null +++ b/include/linux/mfd/sy7636a.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Functions to access SY3686A power management chip. + * + * Copyright (C) 2021 reMarkable AS - http://www.remarkable.com/ + */ + +#ifndef __MFD_SY7636A_H +#define __MFD_SY7636A_H + +#include +#include +#include +#include + +#define SY7636A_REG_OPERATION_MODE_CRL 0x00 +#define SY7636A_OPERATION_MODE_CRL_VCOMCTL BIT(6) +#define SY7636A_OPERATION_MODE_CRL_ONOFF BIT(7) +#define SY7636A_REG_VCOM_ADJUST_CTRL_L 0x01 +#define SY7636A_REG_VCOM_ADJUST_CTRL_H 0x02 +#define SY7636A_REG_VCOM_ADJUST_CTRL_MASK 0x01ff +#define SY7636A_REG_VLDO_VOLTAGE_ADJULST_CTRL 0x03 +#define SY7636A_REG_POWER_ON_DELAY_TIME 0x06 +#define SY7636A_REG_FAULT_FLAG 0x07 +#define SY7636A_FAULT_FLAG_PG BIT(0) +#define SY7636A_REG_TERMISTOR_READOUT 0x08 + +#define SY7636A_REG_MAX 0x08 + +#define VCOM_MIN 0 +#define VCOM_MAX 5000 + +#define VCOM_ADJUST_CTRL_MASK 0x1ff +// Used to shift the high byte +#define VCOM_ADJUST_CTRL_SHIFT 8 +// Used to scale from VCOM_ADJUST_CTRL to mv +#define VCOM_ADJUST_CTRL_SCAL 10000 + +#define FAULT_FLAG_SHIFT 1 + +#endif /* __LINUX_MFD_SY7636A_H */ From patchwork Wed Aug 18 15:44:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500624 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 52663C4338F for ; Thu, 19 Aug 2021 11:16:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AF6D61100 for ; Thu, 19 Aug 2021 11:16:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238675AbhHSLQp (ORCPT ); Thu, 19 Aug 2021 07:16:45 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:42519 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238577AbhHSLQl (ORCPT ); Thu, 19 Aug 2021 07:16:41 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6EC295C00C9; Thu, 19 Aug 2021 07:16:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 19 Aug 2021 07:16:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=e6he+/Ctx/CNm IsbU2QMgTzDIo771ajT2nYYxlA1LyM=; b=FPPsQWSaWd0pXA2DuBwOLiW6FFbP/ tLXSeQeulECpS9Vqh62ExYqX7gW3mg4r3YR1Lbi4h5XXUdjDpEucwBTd46FJjDUU TE1R6EOOUBZHXVpp+Y0r8gf9TQ4+or33A2vRuUASICtbL+qp0mcNm6gJ5UMVYFgr O9QVweyjDKQqltEq53UexZLGsPU7ezhQfiOq2Dr/eTwXmoRBdgAxVJhCseakyVjI FYYzUEGDpHc/IEI3OFSSzZLWiqTDX8jQMm/rBNh5Wbz0yKAumzsk97fuxVGIsZeO mmyFTsQ6g14gUc9A4Tsai63g7blTdni/b1doNrT3XjqSE3juXGSiGXs4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=e6he+/Ctx/CNmIsbU2QMgTzDIo771ajT2nYYxlA1LyM=; b=HNiJ0D8C adTE4Hg3ErKly7OUJkM71+NxT0tSQLtc4DECSHtCNEjOx2jLEZL82iYJfrlbFKHX aBcZx3xDP+ZW8aEuhkLg4DN569E7LpQRlCIpcdKFBMvyqF3Y3QCeez6RTALHJNSO nuo4LaNVah71hAfucjT1AeVg6zfFWS+z1E3SNesCRSxJ31eqYmidq4hF701ZnE+n wgDE16ncG4m62jISSv8u6Ja7wpnX/AUUDbRFD0GG7hgGT+ErTooZ7QzNNxMaRv6K EXOphBB/9ZsIcM26Uc2X0Ij1ZyN2CNewIuU2VQtwAO/fL5+7T2rK+tHnZtZjgQdn 4ClAjdzNNcDKCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:16:01 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v11 04/10] regulator: sy7636a: Remove requirement on sy7636a mfd Date: Thu, 19 Aug 2021 01:44:43 +1000 Message-Id: <20210818154449.1037-5-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Alistair Francis --- drivers/regulator/Kconfig | 1 - drivers/regulator/sy7636a-regulator.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 24ce9a17ab4f..54ba141d114a 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -1179,7 +1179,6 @@ config REGULATOR_STW481X_VMMC config REGULATOR_SY7636A tristate "Silergy SY7636A voltage regulator" - depends on MFD_SY7636A help This driver supports Silergy SY3686A voltage regulator. diff --git a/drivers/regulator/sy7636a-regulator.c b/drivers/regulator/sy7636a-regulator.c index 8360b3947ead..22fddf868e4c 100644 --- a/drivers/regulator/sy7636a-regulator.c +++ b/drivers/regulator/sy7636a-regulator.c @@ -70,7 +70,7 @@ static const struct regulator_desc desc = { static int sy7636a_regulator_probe(struct platform_device *pdev) { - struct regmap *regmap = dev_get_drvdata(pdev->dev.parent); + struct regmap *regmap = dev_get_regmap(pdev->dev.parent, NULL); struct regulator_config config = { }; struct regulator_dev *rdev; struct gpio_desc *gdp; From patchwork Wed Aug 18 15:44:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499901 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 25C11C4338F for ; Thu, 19 Aug 2021 11:16:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 099CF60E90 for ; Thu, 19 Aug 2021 11:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238550AbhHSLQs (ORCPT ); Thu, 19 Aug 2021 07:16:48 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:57183 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238465AbhHSLQp (ORCPT ); Thu, 19 Aug 2021 07:16:45 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 001A55C0076; Thu, 19 Aug 2021 07:16:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 19 Aug 2021 07:16:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=pyVtUnZYzGrcH 1g1RkGLXUcs/0mV92qZW3HWmcKlct4=; b=HeS/Jp8PsFo6dXD0Iv+NeaX/aYqy3 tNlHMO66L2KVZvIRTnCZoMtieio5LGyk+HXP9vhjZ0/e9EoOLyydgoC51y1jENud 3/55GOu8deRsM18TvNjYfS+wZeOV6t9PMyNefy/CGu7WF3EahRpFcTYvPz2nMH8/ 0+XvQk5syPiSYaLMbMlNh3wl5upJ1e2nYhHY5hMq/0Qs6zW3xNQ1Qlp6haX00BJ5 kLvvb+yQyswRbXKCJtnYpbwiP4+tvIImUcTy+jkS+swP7Kx3qq4ZL4+kektnX5rT 2wJAJfdlpcRRbuUA/EyUMY32M+on8pcgBq1lGagO+2njBbxMr4gpDIgzg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=pyVtUnZYzGrcH1g1RkGLXUcs/0mV92qZW3HWmcKlct4=; b=V1No3on0 tbkDFYCbCyo/vKR207JcIG5k8dbvP/Ae4seaYrVQJEBK4m72xGQ9hdFoSROwnSaG kZrgOTEp7zzGrdeifedxOcSGPnSKRVqMwJSKCxmhXfNeWqyDySLv6OtvubtQx/hH JgyY3dbGGfmwjSiU4rKirx/MBd2fQvcRrY145/tsRBvHVy6xvzVAgTSyBiYfQ01E vpf1tcRQyj36Xczuxa4uS3yO77BiVWW2V6iNzjxaSo6oOo07BnRLi8ltfNY+d9EI Sg0Plf+/GtphOb7zdYw2dbJWCN+qka3ZC0M1sag3mgMO8uByr8pi+9WpGss9pquB j3qK6nUmig+/sw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepheffjeetteetke ffhfdvgefhgeevvddvueejheehfeevfedufeegiedtheeujeelnecuffhomhgrihhnpehr vghmrghrkhgrsghlvgdrtghomhenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmh epmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:16:05 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v11 05/10] thermal: sy7636a: Add thermal driver for sy7636a Date: Thu, 19 Aug 2021 01:44:44 +1000 Message-Id: <20210818154449.1037-6-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add thermal driver to enable kernel based polling and shutdown of device for temperatures out of spec Signed-off-by: Alistair Francis --- drivers/thermal/Kconfig | 6 ++ drivers/thermal/Makefile | 1 + drivers/thermal/sy7636a_thermal.c | 94 +++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 drivers/thermal/sy7636a_thermal.c diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index d7f44deab5b1..6ee0e7de1b37 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -450,6 +450,12 @@ depends on (ARCH_STI || ARCH_STM32) && OF source "drivers/thermal/st/Kconfig" endmenu +config SY7636A_THERMAL + tristate "SY7636A thermal management" + help + Enable the sy7636a thermal driver, which supports the + temperature sensor embedded in Silabs SY7636A IC. + source "drivers/thermal/tegra/Kconfig" config GENERIC_ADC_THERMAL diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile index 82fc3e616e54..2e1aca8a0a09 100644 --- a/drivers/thermal/Makefile +++ b/drivers/thermal/Makefile @@ -51,6 +51,7 @@ obj-$(CONFIG_DA9062_THERMAL) += da9062-thermal.o obj-y += intel/ obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/ obj-y += st/ +obj-$(CONFIG_SY7636A_THERMAL) += sy7636a_thermal.o obj-$(CONFIG_QCOM_TSENS) += qcom/ obj-y += tegra/ obj-$(CONFIG_HISI_THERMAL) += hisi_thermal.o diff --git a/drivers/thermal/sy7636a_thermal.c b/drivers/thermal/sy7636a_thermal.c new file mode 100644 index 000000000000..9e58305ca3ce --- /dev/null +++ b/drivers/thermal/sy7636a_thermal.c @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Functions to access SY3686A power management chip temperature + * + * Copyright (C) 2019 reMarkable AS - http://www.remarkable.com/ + * + * Authors: Lars Ivar Miljeteig + * Alistair Francis + */ + +#include +#include +#include + +#include + +static int sy7636a_get_temp(void *arg, int *res) +{ + unsigned int mode_ctr; + int ret, reg_val; + struct regmap *regmap = arg; + bool isVoltageActive; + + ret = regmap_read(regmap, + SY7636A_REG_OPERATION_MODE_CRL, &mode_ctr); + if (ret) + return ret; + + isVoltageActive = mode_ctr & SY7636A_OPERATION_MODE_CRL_ONOFF; + + /* If operation mode isn't set to control, then let's set it. */ + if (!isVoltageActive) { + ret = regmap_write(regmap, + SY7636A_REG_OPERATION_MODE_CRL, + mode_ctr | SY7636A_OPERATION_MODE_CRL_ONOFF); + if (ret) + return ret; + } + + ret = regmap_read(regmap, + SY7636A_REG_TERMISTOR_READOUT, ®_val); + if (ret) + return ret; + + /* Restore the operation mode if it wasn't set */ + if (!isVoltageActive) { + ret = regmap_write(regmap, + SY7636A_REG_OPERATION_MODE_CRL, + mode_ctr); + if (ret) + return ret; + } + + *res = reg_val * 1000; + + return ret; +} + +static const struct thermal_zone_of_device_ops ops = { + .get_temp = sy7636a_get_temp, +}; + +static int sy7636a_thermal_probe(struct platform_device *pdev) +{ + struct regmap *regmap = dev_get_regmap(pdev->dev.parent, NULL); + struct thermal_zone_device *thermal_zone_dev; + + thermal_zone_dev = devm_thermal_zone_of_sensor_register( + pdev->dev.parent, + 0, + regmap, + &ops); + + return PTR_ERR_OR_ZERO(thermal_zone_dev); +} + +static const struct platform_device_id sy7636a_thermal_id_table[] = { + { "sy7636a-thermal", }, + { } +}; +MODULE_DEVICE_TABLE(platform, sy7636a_thermal_id_table); + +static struct platform_driver sy7636a_thermal_driver = { + .driver = { + .name = "sy7636a-thermal", + }, + .probe = sy7636a_thermal_probe, + .id_table = sy7636a_thermal_id_table, +}; +module_platform_driver(sy7636a_thermal_driver); + +MODULE_AUTHOR("Lars Ivar Miljeteig "); +MODULE_DESCRIPTION("SY7636A thermal driver"); +MODULE_LICENSE("GPL v2"); From patchwork Wed Aug 18 15:44:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500623 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 64192C432BE for ; Thu, 19 Aug 2021 11:16:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47B7461166 for ; Thu, 19 Aug 2021 11:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238698AbhHSLQu (ORCPT ); Thu, 19 Aug 2021 07:16:50 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:60373 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238586AbhHSLQs (ORCPT ); Thu, 19 Aug 2021 07:16:48 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8DA345C0115; Thu, 19 Aug 2021 07:16:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 19 Aug 2021 07:16:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=s+ynalgx4AfI6 lhKtqWRsNO/wGBu9KnuiZQIKAZ6TcM=; b=RzI6thyq+g2cNAT8gW5hnmbkiz8XM Z7VHnMLL8AlBU5m7OSaP0YfukRU3HI4XQpG+tkRL9dhyWYSeuZVcDeHKQTCMUXMO XofJAOuVPNk+7iYtlBwpxUeaI5kIHf1Z2O9MX7VwJTXm/aY88mq7gTG+1MXs3yk0 IpFaENbC7wQUbHLnxI2WpTM5XGYue7FR7jbT6RaMN83y+3kQ6xztwoNnSSdlofUC e+dX9pfKOzmQGF8VXjOQyj5+/BuSjr8y1RXcjMH55TYzXmz/FnZF4Hvhw13dWbkq sQYIPmU5DtS8DOwr8rE1fjPMT4nqY93jEdzhQsCoOfqdpgZxzpesf/fmQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=s+ynalgx4AfI6lhKtqWRsNO/wGBu9KnuiZQIKAZ6TcM=; b=SbHgLpzG TTGIVJnMqQOkbkeTTDUW+tk96ckk6f91RpKl3Ww3mDL3CW9CLHdyNwzEKdX5Ez/Z zuYkjacM3840w7hInjHQIbsBKknsLS7C+INAg2cjKfr3aNRRl9i+Stm2gz89efE8 tI6XagQfk4LCZUfSiw5/CQTwbp9K995X1vDlC892gtgOvOV4XUnB4Hqtgnk2DvYd WiC5pleWREl2caT7rlyLUmOarW6zGoQxxERT812sDkm3U4dOdrZfu3WprlH/H9wD rWzoNQzEGep4yH40/f5lNXpxTGk9lMblbi4nZ3DvCywgGnH2uBxErdCUaqvCdS+S PaTIRC6rkcyRlg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepheffjeetteetke ffhfdvgefhgeevvddvueejheehfeevfedufeegiedtheeujeelnecuffhomhgrihhnpehr vghmrghrkhgrsghlvgdrtghomhenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmh epmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:16:09 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v11 06/10] hwmon: sy7636a: Add temperature driver for sy7636a Date: Thu, 19 Aug 2021 01:44:45 +1000 Message-Id: <20210818154449.1037-7-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This is a multi-function device to interface with the sy7636a EPD PMIC chip from Silergy. Signed-off-by: Alistair Francis --- arch/arm/configs/imx_v6_v7_defconfig | 1 + drivers/hwmon/Kconfig | 10 ++++ drivers/hwmon/Makefile | 1 + drivers/hwmon/sy7636a-hwmon.c | 77 ++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+) create mode 100644 drivers/hwmon/sy7636a-hwmon.c diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index 477dac1edc75..ef8c6dca1277 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -229,6 +229,7 @@ CONFIG_RN5T618_POWER=m CONFIG_SENSORS_MC13783_ADC=y CONFIG_SENSORS_GPIO_FAN=y CONFIG_SENSORS_IIO_HWMON=y +CONFIG_SENSORS_SY7636A=y CONFIG_THERMAL_STATISTICS=y CONFIG_THERMAL_WRITABLE_TRIPS=y CONFIG_CPU_THERMAL=y diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index e3675377bc5d..6cae12de59cd 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -1631,6 +1631,16 @@ config SENSORS_SIS5595 This driver can also be built as a module. If so, the module will be called sis5595. +config SENSORS_SY7636A + tristate "Silergy SY7636A" + depends on I2C + help + If you say yes here you get support for the thermistor readout of + the Silergy SY7636A PMIC. + + This driver can also be built as a module. If so, the module + will be called sy7636a-hwmon. + config SENSORS_DME1737 tristate "SMSC DME1737, SCH311x and compatibles" depends on I2C && !PPC diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index d712c61c1f5e..8b2e09e25b24 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -180,6 +180,7 @@ obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o obj-$(CONFIG_SENSORS_SPARX5) += sparx5-temp.o obj-$(CONFIG_SENSORS_STTS751) += stts751.o +obj-$(CONFIG_SENSORS_SY7636A) += sy7636a-hwmon.o obj-$(CONFIG_SENSORS_AMC6821) += amc6821.o obj-$(CONFIG_SENSORS_TC74) += tc74.o obj-$(CONFIG_SENSORS_THMC50) += thmc50.o diff --git a/drivers/hwmon/sy7636a-hwmon.c b/drivers/hwmon/sy7636a-hwmon.c new file mode 100644 index 000000000000..e0204278339b --- /dev/null +++ b/drivers/hwmon/sy7636a-hwmon.c @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Functions to access SY3686A power management chip temperature + * + * Copyright (C) 2019 reMarkable AS - http://www.remarkable.com/ + * + * Authors: Lars Ivar Miljeteig + * Alistair Francis + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static ssize_t show_temp(struct device *dev, + struct device_attribute *attr, char *buf) +{ + unsigned int reg_val; + struct regmap *regmap = dev_get_drvdata(dev); + int ret; + + ret = regmap_read(regmap, + SY7636A_REG_TERMISTOR_READOUT, ®_val); + if (ret) + return ret; + + return snprintf(buf, PAGE_SIZE, "%d\n", reg_val); +} + +static SENSOR_DEVICE_ATTR(temp0, 0444, show_temp, NULL, 0); + +static struct attribute *sy7636a_attrs[] = { + &sensor_dev_attr_temp0.dev_attr.attr, + NULL +}; + +ATTRIBUTE_GROUPS(sy7636a); + +static int sy7636a_sensor_probe(struct platform_device *pdev) +{ + struct regmap *regmap = dev_get_regmap(pdev->dev.parent, NULL); + struct device *hwmon_dev; + int err; + + if (!regmap) + return -EPROBE_DEFER; + + hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev, + "sy7636a_temperature", regmap, sy7636a_groups); + + if (IS_ERR(hwmon_dev)) { + err = PTR_ERR(hwmon_dev); + dev_err(&pdev->dev, "Unable to register hwmon device, returned %d", err); + return err; + } + + return 0; +} + +static struct platform_driver sy7636a_sensor_driver = { + .probe = sy7636a_sensor_probe, + .driver = { + .name = "sy7636a-temperature", + }, +}; +module_platform_driver(sy7636a_sensor_driver); + +MODULE_DESCRIPTION("SY7636A sensor driver"); +MODULE_LICENSE("GPL"); From patchwork Wed Aug 18 15:44:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499900 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 5B4B6C4320A for ; Thu, 19 Aug 2021 11:16:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4303460E90 for ; Thu, 19 Aug 2021 11:16:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238715AbhHSLQy (ORCPT ); Thu, 19 Aug 2021 07:16:54 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:58375 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238682AbhHSLQx (ORCPT ); Thu, 19 Aug 2021 07:16:53 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AC29A5C00C9; Thu, 19 Aug 2021 07:16:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 19 Aug 2021 07:16:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=Vy2JXd+xDZiD5 L7+tWVvVGFaD+OJoxcOJYpYwczbUeE=; b=MaDsLR0Ci3uKSAmXJWh3K8391O73B lfedFZm0vvlwhHCm1y0egq2Cota/MBOzOjjXCofq67avC0XoZN3NtbD9CRlpOHEZ V735Csxt5srKbu/AgATsNuJUeeScN25ZWuVc+kPAGpzXYotEsQjlxQgSxRxYl0wS ggNT/lsuyYQLox7nVKa4/idB0joh6oCq37X1RX7LKbEYgXd30IowI1N//ulpI26w 1WCklQTLyhYOX1wpeiHo6Q7q/6NpTSlsxu6n+A9AIxSaR0T8vbi9Qcm1zhIiqkzu H7xKlpOkTZyFKLiw/qfAscGv+8uySWlbOkCdnk9XPnaspZ8fR7JFR8EDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=Vy2JXd+xDZiD5L7+tWVvVGFaD+OJoxcOJYpYwczbUeE=; b=fwsajerR vgoCIOh42lsMNP/SWWXezKwFnbH7+PdhtW1kA5u9GlyK9yaC1KoyvlEPziukKHbG Bk8yCewKfNMXz2a/SbfB0D69OUBd5vFRVER757RgP45M7ozhcfjdV8xW3DcPRNZZ 1Ycpa8+5sjCyJmMYmlN7bcJLXjPfHGRSLueBQyFM56PnMPyTiRoyGThq5BsDa0JL hjflz3ZZubakvTf0HeVbMuXk0xywi1eucN9QwWZTKt0oOD+y1zwyog+BhjS+zAFh o4+xEtqWzhcmfyeHotY4fS8o3qrrEFoLdfk2IpIVf34ZbLpHwHi063NAsvyCKo28 41sEx3MzLNdH6g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepudenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:16:12 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v11 07/10] ARM: imx_v6_v7_defconfig: Enable silergy,sy7636a Date: Thu, 19 Aug 2021 01:44:46 +1000 Message-Id: <20210818154449.1037-8-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Enable the silergy,sy7636a and silergy,sy7636a-regulator for the reMarkable2. Signed-off-by: Alistair Francis --- arch/arm/configs/imx_v6_v7_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index ef8c6dca1277..0ac7c61c6f3d 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -234,6 +234,7 @@ CONFIG_THERMAL_STATISTICS=y CONFIG_THERMAL_WRITABLE_TRIPS=y CONFIG_CPU_THERMAL=y CONFIG_IMX_THERMAL=y +CONFIG_SY7636A_THERMAL=y CONFIG_WATCHDOG=y CONFIG_DA9062_WATCHDOG=y CONFIG_DA9063_WATCHDOG=m @@ -249,6 +250,7 @@ CONFIG_MFD_RN5T618=y CONFIG_MFD_STMPE=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_MFD_SIMPLE_MFD_I2C=y CONFIG_REGULATOR_ANATOP=y CONFIG_REGULATOR_DA9052=y CONFIG_REGULATOR_DA9062=y @@ -258,6 +260,7 @@ CONFIG_REGULATOR_MC13783=y CONFIG_REGULATOR_MC13892=y CONFIG_REGULATOR_PFUZE100=y CONFIG_REGULATOR_RN5T618=y +CONFIG_REGULATOR_SY7636A=y CONFIG_RC_CORE=y CONFIG_RC_DEVICES=y CONFIG_IR_GPIO_CIR=y From patchwork Wed Aug 18 15:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500622 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 E0A5CC4338F for ; Thu, 19 Aug 2021 11:16:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C66DC61155 for ; Thu, 19 Aug 2021 11:16:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238769AbhHSLRK (ORCPT ); Thu, 19 Aug 2021 07:17:10 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:45139 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238785AbhHSLQ5 (ORCPT ); Thu, 19 Aug 2021 07:16:57 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 61DBE5C0076; Thu, 19 Aug 2021 07:16:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 19 Aug 2021 07:16:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=OcxDmT6yzDNfT /cRSP0vqtlrxPSFTAH5XRTlf5MSQVA=; b=atg/5DJBzmwu2uLkh2rq/TUMU5Wu/ zpTxAizVp/bGxVIBb/QajNB27bOsN3865z6tuVBgsWxy2fH4p3Istv6/thBNZUdD +x4TEbqn8i8C1Wi3qh0MN2MYqtjkNUkZQn1VZLdxiIh/QlTbwVnAUIYr9jazxPe6 50Oovyc1pjIBFkG01e2qQhykHLm6O2B4DaQM4TZtgcJChmFxyGzFRbmaCjf928md WP0pL6HPzdotCbB/FCp/NIxg6bi6PXcvQtlqVjFEr/E1TTtRMUckbHCVR+FzPTMV wAxFn0NpUwWjIflJOss3ESt0n63TTfNlKRoRciKx9O3apQv2etrpUoQYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=OcxDmT6yzDNfT/cRSP0vqtlrxPSFTAH5XRTlf5MSQVA=; b=SwwheKrU JVaR9Xo6ZVZ1rcZIbeoJsRVtOtS74pvbuH3xtcV2TiKjtu57/U/p9MCHA1fbiV12 a/4pJNUjGCFRSzagu7+3Xg+6H5RETuZF4hZ0eMPqrzJKKIIbQwAVYBXz5dYE9zWI B8wuFKbhxEpAllljG/KzplPVPw+E2xPjKNtPXKMXgr6q5awJDac55SvwnZYMeToD T5LTe54xnel0FaGfHFDeFUSsO9so1+rY8e9hjBQUlwWJecsJ24cW6iIW1Hh9V3oH 1IeIzsH3dkI4/nmLwhJt+eTUnjp6fUcXWX1Fvsh/uB40WCxducevciqmzGrBfj2u PjLtP3IvnvX4qw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepvdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:16:17 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v11 08/10] ARM: dts: imx7d: remarkable2: Enable silergy, sy7636a Date: Thu, 19 Aug 2021 01:44:47 +1000 Message-Id: <20210818154449.1037-9-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Enable the silergy,sy7636a and silergy,sy7636a-regulator on the reMarkable2. Signed-off-by: Alistair Francis --- arch/arm/boot/dts/imx7d-remarkable2.dts | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts index 052f9da32398..ab2f61d9c635 100644 --- a/arch/arm/boot/dts/imx7d-remarkable2.dts +++ b/arch/arm/boot/dts/imx7d-remarkable2.dts @@ -86,6 +86,33 @@ wacom_digitizer: digitizer@9 { }; }; +&i2c4 { + clock-frequency = <100000>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&pinctrl_i2c4>; + pinctrl-1 = <&pinctrl_i2c4>; + status = "okay"; + + epd_pmic: sy7636a@62 { + compatible = "silergy,sy7636a"; + reg = <0x62>; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_epdpmic>; + #address-cells = <1>; + #size-cells = <0>; + #thermal-sensor-cells = <0>; + + epd-pwr-good-gpios = <&gpio6 21 GPIO_ACTIVE_HIGH>; + regulators { + reg_epdpmic: vcom { + regulator-name = "vcom"; + regulator-boot-on; + }; + }; + }; +}; + &snvs_pwrkey { status = "okay"; }; @@ -179,6 +206,13 @@ MX7D_PAD_SAI1_TX_BCLK__GPIO6_IO13 0x14 >; }; + pinctrl_epdpmic: epdpmicgrp { + fsl,pins = < + MX7D_PAD_SAI2_RX_DATA__GPIO6_IO21 0x00000074 + MX7D_PAD_ENET1_RGMII_TXC__GPIO7_IO11 0x00000014 + >; + }; + pinctrl_i2c1: i2c1grp { fsl,pins = < MX7D_PAD_I2C1_SDA__I2C1_SDA 0x4000007f @@ -186,6 +220,13 @@ MX7D_PAD_I2C1_SCL__I2C1_SCL 0x4000007f >; }; + pinctrl_i2c4: i2c4grp { + fsl,pins = < + MX7D_PAD_I2C4_SDA__I2C4_SDA 0x4000007f + MX7D_PAD_I2C4_SCL__I2C4_SCL 0x4000007f + >; + }; + pinctrl_uart1: uart1grp { fsl,pins = < MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX 0x79 From patchwork Wed Aug 18 15:44:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499899 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 7D2B4C4320A for ; Thu, 19 Aug 2021 11:16:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69710610E6 for ; Thu, 19 Aug 2021 11:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238817AbhHSLRM (ORCPT ); Thu, 19 Aug 2021 07:17:12 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:54497 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238733AbhHSLRC (ORCPT ); Thu, 19 Aug 2021 07:17:02 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 770025C00C9; Thu, 19 Aug 2021 07:16:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 07:16:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=D5XAa6mnxzOob ICi+NDfgLGr0+PRNm4JdFb6bI4vo6Q=; b=W5ahaGDqx2Seh2kQfGPuUxnXrxwRy FGFpA1vRKDMBaOBkemOPSOqB/mKsUDtyzolnGu/pQ1qWSPyJJaW1ObNi0R5mVQP1 vvuHAsfZS2yO1JNyVLayq7dl8SWfPtt5Xn8orYMbGo3AMJsltd8MJyRUKToumNWr qBTSq7fsgzHyaq2acZpcGn8f3VHiFdCfZS8cZa9gIDc/LgBDd2zA6GuqaeAaGnji cQmGvL0WHdvmC77OMr7qv9QSW8M5xFGylvtItQkEOtjTmT6C7hSIzzbjPNm26GM6 P4Rtd0OkYVKh0G0PZV8PmGnLnLjKtMiDLzyHIItOlwWBhc9ZYEI8K38EA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=D5XAa6mnxzOobICi+NDfgLGr0+PRNm4JdFb6bI4vo6Q=; b=XUVot1kV fwEmsOmt86r2imJUlVubGX7pucrIVQ04HKjLqrNYjWgYnGy5RNcJy0OuWHCE7i79 Qw9zWCvdhpGQDBPC4UYcfO8Er6iQkNqWv2JjREkOIZH5mFN28dFL2zjfFY3Hs7LM nTmrq5l6z9KtNhIPslkJ0bxT1S7nfcfUB+SCZ5H2Y93i9QcQOmwCWM/VB8ZCS3/Y WHMoOotsHRW+ECdGQDFfd0ODSJGiQ+Nqk48xR+X9+6O4hb3X6G1qj1PPkp/N7i0V Jwr3yV/nWwNaqbqh5xxN+p4Y3m9m3gukZUD3lukTvMhEXcT6QuCI9tXVmMXBmRDa TxFACe0worFUJQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepudenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:16:21 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v11 09/10] ARM: imx_v6_v7_defconfig: Enable backlight class devices Date: Thu, 19 Aug 2021 01:44:48 +1000 Message-Id: <20210818154449.1037-10-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The BACKLIGHT_CLASS_DEVICE config is required for the already enabled DRM_SIMPLE_PANEL to work so let's enable BACKLIGHT_CLASS_DEVICE. This allows the mxsfb probe to complete successfully on the reMarkable 2. Signed-off-by: Alistair Francis --- arch/arm/configs/imx_v6_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index 0ac7c61c6f3d..486c59cdb174 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -300,6 +300,7 @@ CONFIG_FB_MODE_HELPERS=y CONFIG_LCD_CLASS_DEVICE=y CONFIG_LCD_L4F00242T03=y CONFIG_LCD_PLATFORM=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_PWM=y CONFIG_BACKLIGHT_GPIO=y CONFIG_FRAMEBUFFER_CONSOLE=y From patchwork Wed Aug 18 15:44:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500621 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 1A764C43214 for ; Thu, 19 Aug 2021 11:16:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04433610E6 for ; Thu, 19 Aug 2021 11:16:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238712AbhHSLRN (ORCPT ); Thu, 19 Aug 2021 07:17:13 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:49889 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238848AbhHSLRF (ORCPT ); Thu, 19 Aug 2021 07:17:05 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8E5E15C012A; Thu, 19 Aug 2021 07:16:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 19 Aug 2021 07:16:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=0Fvpa8Z1R1zqH Pq5M4cA9gD9N1aHb4dJ5to/1Pfz26w=; b=mQTnHRdD/nJGO/euOcgmyAynEISTj bTDqr4m18waLWD7WpVs2p3Zdh2m21kovcZ/bMSBMsN2ikUfWuETJJuiexulwOgeh jrAYDg53ckHUXlLriyd0I6+s+23HwMnxKmKuisu+3FOmJzZ4atEBqVYopkbK+O8F SIKsnGkFQQQUbCuAZLHbNCYU+o3qBHYwctmn/szesxsmRvQEwqQSq6GgS90F62fk ABcWM98HJMU+lcFzk0F2h8bH2FLgqFwVhmDgCv2SfHbIqHOQfBWsKwvMh7uruMiu JTwCVKxYEu5lIumX/OaV7j2KBEXqXIOhpFZjhSYEEDYJlz67gqe4mzZ0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=0Fvpa8Z1R1zqHPq5M4cA9gD9N1aHb4dJ5to/1Pfz26w=; b=a0ReVDKF h4ozwZe74QzM5NwRQ2WbsUVtK4xq1bxrPvfpCkQ7fnGCdu+MMQLXj3HuNtb2frnl 0Rc/SWeOMbakwHM8KXFEXZCpC0flsRDLMDhU7gcmQwNGxxjwtxnjPg5FvzyOZiEX UAteZUdZDZycTUDtn4jfsKW6caM9KbNT1P7ElGsulRmCyZJpPUMZK/V/m8QkieUL w8EUWpQe9eLbmrGsJorDSwRLFAbOnzH0lqwYRJ8nvh3kNrhmRdc2SZz51eg0DZrN jNzj5ZpS7dFSxXCzvFP7j5+qfSjcQ/+9iBDGuK0DPffoT4vtqmfkGWTTcL6AvVyZ 3oLei2WneAxCOQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepfeenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:16:25 -0400 (EDT) From: Alistair Francis To: lee.jones@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v11 10/10] ARM: dts: imx7d: remarkable2: Enable lcdif Date: Thu, 19 Aug 2021 01:44:49 +1000 Message-Id: <20210818154449.1037-11-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154449.1037-1-alistair@alistair23.me> References: <20210818154449.1037-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Connect the dispaly on the reMarkable2. Signed-off-by: Alistair Francis --- arch/arm/boot/dts/imx7d-remarkable2.dts | 74 +++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts index ab2f61d9c635..7a48ffb14498 100644 --- a/arch/arm/boot/dts/imx7d-remarkable2.dts +++ b/arch/arm/boot/dts/imx7d-remarkable2.dts @@ -47,6 +47,16 @@ reg_digitizer: regulator-digitizer { startup-delay-us = <100000>; /* 100 ms */ }; + reg_sdoe: regulator-sdoe { + compatible = "regulator-fixed"; + regulator-name = "SDOE"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&pinctrl_sdoe_reg>; + pinctrl-1 = <&pinctrl_sdoe_reg>; + gpio = <&gpio3 27 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + wifi_pwrseq: wifi_pwrseq { compatible = "mmc-pwrseq-simple"; pinctrl-names = "default"; @@ -55,6 +65,16 @@ wifi_pwrseq: wifi_pwrseq { clocks = <&clks IMX7D_CLKO2_ROOT_DIV>; clock-names = "ext_clock"; }; + + panel { + compatible = "eink,vb3300-kca"; + + port { + panel_in: endpoint { + remote-endpoint = <&display_out>; + }; + }; + }; }; &clks { @@ -113,6 +133,20 @@ reg_epdpmic: vcom { }; }; +&lcdif { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_lcdif>; + lcd-supply = <®_epdpmic>; + lcd2-supply = <®_sdoe>; + status = "okay"; + + port { + display_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; +}; + &snvs_pwrkey { status = "okay"; }; @@ -227,6 +261,46 @@ MX7D_PAD_I2C4_SCL__I2C4_SCL 0x4000007f >; }; + pinctrl_lcdif: lcdifgrp { + fsl,pins = < + MX7D_PAD_LCD_DATA00__LCD_DATA0 0x79 + MX7D_PAD_LCD_DATA01__LCD_DATA1 0x79 + MX7D_PAD_LCD_DATA02__LCD_DATA2 0x79 + MX7D_PAD_LCD_DATA03__LCD_DATA3 0x79 + MX7D_PAD_LCD_DATA04__LCD_DATA4 0x79 + MX7D_PAD_LCD_DATA05__LCD_DATA5 0x79 + MX7D_PAD_LCD_DATA06__LCD_DATA6 0x79 + MX7D_PAD_LCD_DATA07__LCD_DATA7 0x79 + MX7D_PAD_LCD_DATA08__LCD_DATA8 0x79 + MX7D_PAD_LCD_DATA09__LCD_DATA9 0x79 + MX7D_PAD_LCD_DATA10__LCD_DATA10 0x79 + MX7D_PAD_LCD_DATA11__LCD_DATA11 0x79 + MX7D_PAD_LCD_DATA12__LCD_DATA12 0x79 + MX7D_PAD_LCD_DATA13__LCD_DATA13 0x79 + MX7D_PAD_LCD_DATA14__LCD_DATA14 0x79 + MX7D_PAD_LCD_DATA15__LCD_DATA15 0x79 + + MX7D_PAD_LCD_DATA17__LCD_DATA17 0x79 + MX7D_PAD_LCD_DATA18__LCD_DATA18 0x79 + MX7D_PAD_LCD_DATA19__LCD_DATA19 0x79 + MX7D_PAD_LCD_DATA20__LCD_DATA20 0x79 + MX7D_PAD_LCD_DATA21__LCD_DATA21 0x79 + + MX7D_PAD_LCD_DATA23__LCD_DATA23 0x79 + MX7D_PAD_LCD_CLK__LCD_CLK 0x79 + MX7D_PAD_LCD_ENABLE__LCD_ENABLE 0x79 + MX7D_PAD_LCD_VSYNC__LCD_VSYNC 0x79 + MX7D_PAD_LCD_HSYNC__LCD_HSYNC 0x79 + MX7D_PAD_LCD_RESET__LCD_RESET 0x79 + >; + }; + + pinctrl_sdoe_reg: sdoereggrp { + fsl,pins = < + MX7D_PAD_LCD_DATA22__GPIO3_IO27 0x74 + >; + }; + pinctrl_uart1: uart1grp { fsl,pins = < MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX 0x79