From patchwork Sat Jun 8 15:55:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691037 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2E23817995A; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=rooUNqSQrOYpnkQdpv2IOzlAeExRoywnL1/e1hWMHdBsLe9YHhP4KBrYRb+/rgY1C6g+9rk1DF0+rdh2NxDmE7F4TwMbsniyGWwSTasG6jAZyqC915B/bEorf44uXU/GD1GGo9KIDe8Wkl8W9A0v4UM4QTX/55P7i0WDWmyJxJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=xQFnxItaw23X3Z5K4ATnqQiJwXgY2xVxtlO/Rvgqwyg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mQAvMd6Fx0gWU1iPPyqatupdCJOEjNTc9IaM8RgaMQBSSPSan9GzrrmlPXGAlQ5vne9ds+Kfh+PLuMFMkzBEI1MuoXNEzunpTUsNVbJ3dbLuKpb+nnsYa0NvJPdbTx+QUZ5jkHIeB97AyiDRflR1ZZGF4Q3q+0TEsV3xLD0YAyA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cEzKPNoH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cEzKPNoH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95776C4AF08; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=xQFnxItaw23X3Z5K4ATnqQiJwXgY2xVxtlO/Rvgqwyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cEzKPNoHMhn9xf1Ojtdi1B7vdXGhBvn2tCBQ66N0C8bjtukBHNRkxGgQmwgTbadqX ytWx3Em/lTxLhSJbOA6YR7FqCFnoaSGBS0obtCtzK4FpxYtwy1B26coyLvOVkz45Se fH+E4ACXwtAbdBPJAL4aMD3+j4vjrwVapiw/lAYdbUWRlDHUcpfSPgF6a/4iLfY6GN ItuoKdjIAxUjPos95C2MjtHXrWvWuTg6sicNiwuuuSiP1FkTnSgXiatgOSOw8g13nq OSSBQBzbpKmIy0PpCaZaovEu9oGZaK1CzKpduLoXFjkbRyXQgehNJ21XmobSNDM3UX SwiP5IoNgcuJQ== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRT-000000003Pt-2StR; Sat, 08 Jun 2024 17:57:19 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Krzysztof Kozlowski Subject: [PATCH v3 01/12] dt-bindings: mfd: pm8008: Add reset gpio Date: Sat, 8 Jun 2024 17:55:15 +0200 Message-ID: <20240608155526.12996-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Describe the optional reset gpio (which may not be wired up). Reviewed-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Linus Walleij Signed-off-by: Johan Hovold --- Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml index 0c75d8bde568..e1e05921afb4 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml @@ -29,6 +29,9 @@ properties: description: Parent interrupt. + reset-gpios: + maxItems: 1 + "#interrupt-cells": const: 2 @@ -97,6 +100,7 @@ additionalProperties: false examples: - | + #include #include #include @@ -115,6 +119,8 @@ examples: interrupt-parent = <&tlmm>; interrupts = <32 IRQ_TYPE_EDGE_RISING>; + reset-gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; + pm8008_gpios: gpio@c000 { compatible = "qcom,pm8008-gpio", "qcom,spmi-gpio"; reg = <0xc000>; From patchwork Sat Jun 8 15:55:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691036 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2E1F5179958; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=bsOfAy2stHRy6Tz1clez7UaEiRNBiJvIdCH4RwJn1mAbfzJDsfxBJ/f2aPUbqXWt6CpCBvzFuLOVUVwFlqBU8HrgdFagwBjGobJnAn+TX4HVqA+fCJDq8ANV04hT9YOZZ/XCr8Yqx+ICUJwZXDYQx9d2rwya4KElngVPUmiZqk8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=pIx9hISv3tD47SUT5qu5as5nwq98Svr/ggvTneh6Yl8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dkSMIkIrael+UHlQ/huvPtFQvBQ0fA2SjA9z0duLcoe29ietU6JBsBct4X03WwfRvJR6ike0iqLxgnTf5iLJnxyg5FOivag1aw80zBMbm7Z4CX+vQ2JAV09TwZGnsG+sZT0O9yNVzQlMc0idgcyHBq/btG2SQn9N9HVySpkR1fM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DoyTdela; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DoyTdela" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92E0EC4AF09; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=pIx9hISv3tD47SUT5qu5as5nwq98Svr/ggvTneh6Yl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DoyTdelatrO7ntOSY6Qv3wpP2E5zYm6eJ5fErtUuz13kSjDqoBENpYXi1FlW0/KHB YJkVDgz2i115rfPg0t7CTguDvKOOKzDGXI8r9BZEuRqGz9YTNBwVoKc6jW1BGErW6l HoE9do2WmNyTHkLxoWBSqEyh88UWsoW5q76vsfHpTbIs9mlOWpY0cjZALWMshreUv0 At59cH2dYw0jxn+HnEjjXo8KroLfHCjLcFbpoyJG7qrHYQqF8TkHUPqn2IxuPpyDOO PHsoECEKn9vcWLuytknXL5s6xpo35gWF9bw1HUAO/SBSiBIyyQsYFjLEya/fs7RWhH iGUpr5V9XZadg== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRT-000000003Pv-2nO6; Sat, 08 Jun 2024 17:57:19 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 02/12] mfd: pm8008: Fix regmap irq chip initialisation Date: Sat, 8 Jun 2024 17:55:16 +0200 Message-ID: <20240608155526.12996-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The regmap irq array is potentially shared between multiple PMICs and should only contain static data. Use a custom macro to initialise also the type fields and drop the unnecessary updates on each probe. Fixes: 6b149f3310a4 ("mfd: pm8008: Add driver for QCOM PM8008 PMIC") Reviewed-by: Bryan O'Donoghue Signed-off-by: Johan Hovold --- drivers/mfd/qcom-pm8008.c | 64 ++++++++++++++------------------------- 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index 3ac3742f438b..f71c490f25c8 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -56,15 +56,25 @@ static unsigned int pm8008_config_regs[] = { INT_POL_LOW_OFFSET, }; -static struct regmap_irq pm8008_irqs[] = { - REGMAP_IRQ_REG(PM8008_IRQ_MISC_UVLO, PM8008_MISC, BIT(0)), - REGMAP_IRQ_REG(PM8008_IRQ_MISC_OVLO, PM8008_MISC, BIT(1)), - REGMAP_IRQ_REG(PM8008_IRQ_MISC_OTST2, PM8008_MISC, BIT(2)), - REGMAP_IRQ_REG(PM8008_IRQ_MISC_OTST3, PM8008_MISC, BIT(3)), - REGMAP_IRQ_REG(PM8008_IRQ_MISC_LDO_OCP, PM8008_MISC, BIT(4)), - REGMAP_IRQ_REG(PM8008_IRQ_TEMP_ALARM, PM8008_TEMP_ALARM, BIT(0)), - REGMAP_IRQ_REG(PM8008_IRQ_GPIO1, PM8008_GPIO1, BIT(0)), - REGMAP_IRQ_REG(PM8008_IRQ_GPIO2, PM8008_GPIO2, BIT(0)), +#define _IRQ(_irq, _off, _mask, _types) \ + [_irq] = { \ + .reg_offset = (_off), \ + .mask = (_mask), \ + .type = { \ + .type_reg_offset = (_off), \ + .types_supported = (_types), \ + }, \ + } + +static const struct regmap_irq pm8008_irqs[] = { + _IRQ(PM8008_IRQ_MISC_UVLO, PM8008_MISC, BIT(0), IRQ_TYPE_EDGE_RISING), + _IRQ(PM8008_IRQ_MISC_OVLO, PM8008_MISC, BIT(1), IRQ_TYPE_EDGE_RISING), + _IRQ(PM8008_IRQ_MISC_OTST2, PM8008_MISC, BIT(2), IRQ_TYPE_EDGE_RISING), + _IRQ(PM8008_IRQ_MISC_OTST3, PM8008_MISC, BIT(3), IRQ_TYPE_EDGE_RISING), + _IRQ(PM8008_IRQ_MISC_LDO_OCP, PM8008_MISC, BIT(4), IRQ_TYPE_EDGE_RISING), + _IRQ(PM8008_IRQ_TEMP_ALARM, PM8008_TEMP_ALARM,BIT(0), IRQ_TYPE_SENSE_MASK), + _IRQ(PM8008_IRQ_GPIO1, PM8008_GPIO1, BIT(0), IRQ_TYPE_SENSE_MASK), + _IRQ(PM8008_IRQ_GPIO2, PM8008_GPIO2, BIT(0), IRQ_TYPE_SENSE_MASK), }; static const unsigned int pm8008_periph_base[] = { @@ -143,38 +153,9 @@ static struct regmap_config qcom_mfd_regmap_cfg = { .max_register = 0xFFFF, }; -static int pm8008_probe_irq_peripherals(struct device *dev, - struct regmap *regmap, - int client_irq) -{ - int rc, i; - struct regmap_irq_type *type; - struct regmap_irq_chip_data *irq_data; - - for (i = 0; i < ARRAY_SIZE(pm8008_irqs); i++) { - type = &pm8008_irqs[i].type; - - type->type_reg_offset = pm8008_irqs[i].reg_offset; - - if (type->type_reg_offset == PM8008_MISC) - type->types_supported = IRQ_TYPE_EDGE_RISING; - else - type->types_supported = (IRQ_TYPE_EDGE_BOTH | - IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW); - } - - rc = devm_regmap_add_irq_chip(dev, regmap, client_irq, - IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data); - if (rc) { - dev_err(dev, "Failed to add IRQ chip: %d\n", rc); - return rc; - } - - return 0; -} - static int pm8008_probe(struct i2c_client *client) { + struct regmap_irq_chip_data *irq_data; int rc; struct device *dev; struct regmap *regmap; @@ -187,9 +168,10 @@ static int pm8008_probe(struct i2c_client *client) i2c_set_clientdata(client, regmap); if (of_property_read_bool(dev->of_node, "interrupt-controller")) { - rc = pm8008_probe_irq_peripherals(dev, regmap, client->irq); + rc = devm_regmap_add_irq_chip(dev, regmap, client->irq, + IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data); if (rc) - dev_err(dev, "Failed to probe irq periphs: %d\n", rc); + dev_err(dev, "failed to add IRQ chip: %d\n", rc); } return devm_of_platform_populate(dev); From patchwork Sat Jun 8 15:55:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691034 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 21807179663; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=Eyb+cUd9AbzXPffvTHOyAWShyoxl/71e16xPnItmWGtzcUT9npYM18e6DF/TKZB6bwsD4rbMQFa0nwdqbhWJELVfNvIkSyml+BTaHZR/9FJ/ccZThDgUx8l1PEHhe8UWYb0HRcI4A90yuYgHsuxUkrNpeVnEBTdyosPZZ3glbkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=CMzX95BYhopK+WIO+dnov/qG98VPRvKcCjXdO2f6tTU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bizGzGa+IiLIB9AysUnZoQzEwFUqCKhebBO8OezqO/XG7TKjhgSfs1q9y1g+YnC7pluX+aTyQi67S9yfcx1TC9qSb5OkHkfVS3h3tIgdH0VM1eY6mjAB1kn/JuHQu3exPtPADT0YaJk3hCCRequgARUG/LRWoZ3JNsN9noceAZg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZAHGxkhn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZAHGxkhn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D50DC4AF07; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=CMzX95BYhopK+WIO+dnov/qG98VPRvKcCjXdO2f6tTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZAHGxkhnaz6McvoQMyLgF7EMrucsNM73Mrfr4cQ2cXDikxh67LPzsbD8B9kcTma2U EvZ4OvkC2wAt84R1/nxJQOAxF1ms19erPKxdjnFVwgVqCudQ1BK765qEkh8+s+U5fX OGTk9IR0stsTNj0sqG1wxbI+F/RItQH0K0N93CqbeXMKJ4QVwX5IzR9kn0r5yVvsB2 xYqOZsHMwo5dq1f591c3kQWgYSzieOMKXLnNJi7y8K1K36+A0X+X80LVyOpduqOdx8 ARiu3gAGm/Lfqaf5dgmuWdIR44ftlwhloj02D8pQ8kMh07BWrB15f9U0USB9KE6a5F R5hvifBMX4uxw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRT-000000003Px-37vN; Sat, 08 Jun 2024 17:57:19 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 03/12] mfd: pm8008: Deassert reset on probe Date: Sat, 8 Jun 2024 17:55:17 +0200 Message-ID: <20240608155526.12996-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Request and deassert any (optional) reset gpio during probe in case it has been left asserted by the boot firmware. Note the reset line is not asserted to avoid reverting to the default I2C address in case the firmware has configured an alternate address. Tested-by: Bryan O'Donoghue Reviewed-by: Linus Walleij Signed-off-by: Johan Hovold --- drivers/mfd/qcom-pm8008.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index f71c490f25c8..5a77155a63d7 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -156,6 +157,7 @@ static struct regmap_config qcom_mfd_regmap_cfg = { static int pm8008_probe(struct i2c_client *client) { struct regmap_irq_chip_data *irq_data; + struct gpio_desc *reset; int rc; struct device *dev; struct regmap *regmap; @@ -167,6 +169,16 @@ static int pm8008_probe(struct i2c_client *client) i2c_set_clientdata(client, regmap); + reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(reset)) + return PTR_ERR(reset); + + /* + * The PMIC does not appear to require a post-reset delay, but wait + * for a millisecond for now anyway. + */ + usleep_range(1000, 2000); + if (of_property_read_bool(dev->of_node, "interrupt-controller")) { rc = devm_regmap_add_irq_chip(dev, regmap, client->irq, IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data); From patchwork Sat Jun 8 15:55:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691040 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 62A7A17B4E9; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=IZxQwa5iF5REz7CaD/r8dk7gLvlX2jagWo48onyzcb9uIibYflcsfbQOLOKCSlY6uFo6+UoOKJti1CMKLwc2OMkeYz8mZBn+R1UXkpq+vKbMGeHHemd86Lsxl/i5cslRKnp7/Tn43nnDu2rN/Evu17mpHGXhZnWPiwG+S/71q/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=xvGDdXmPugW8gDTyzx+vdea6PEvo7eNqJuG1wNKxm9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J8JomugPqJ3ldyXIFKVhbcdPhf00cs62BxwUH0RARJJd6qcAvOlX55+FM4jtLQIhQmKDAzkmP7zTFyxCg0J54jT/nYqYpVCLukRTATmTJCIY7cYmteKR8dbbZlJ0LN0/k+2VBU1r1VcCEQf4TkwDj7DUHF8tLMC/kzggpJocC9A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RknpwIy9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RknpwIy9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A875C4AF0B; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=xvGDdXmPugW8gDTyzx+vdea6PEvo7eNqJuG1wNKxm9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RknpwIy9ywVh90i88yY6pRVCslHbAesaWxPMnrgDzPLtlgW0R1fn+mZemOpQeeQyY ZGJuMOlRpPjbI1SlH53KxEhjEPUtns8Ot2aWJ8A2JrPT8slHverQH9mmael1hP1YDQ xHsJpL6LPCsKBapD+6ZzIIcrCslWznX5XFgF2T65F45i/jWG1wTjDfzDeKF6s/YKmH LYXkqhjEznA7lYn/FTSrrp5kvHur62r7iTCEoL9qZeegR66OhCFmGfj+XaB6PYAT47 UeV4amShsexMNg2h/Q+s6tr3+QhaF2XeM6wFPW2tdc78ncHUQi6uaSA36K3yw3lRGB 0u5bRkq207aUQ== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRT-000000003Pz-3Rt2; Sat, 08 Jun 2024 17:57:19 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 04/12] mfd: pm8008: Mark regmap structures as const Date: Sat, 8 Jun 2024 17:55:18 +0200 Message-ID: <20240608155526.12996-5-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The regmap irq chip structures can be const so mark them as such. Reviewed-by: Bryan O'Donoghue Reviewed-by: Stephen Boyd Signed-off-by: Johan Hovold --- drivers/mfd/qcom-pm8008.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index 5a77155a63d7..ab55d524c27b 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -51,7 +51,7 @@ enum { POLARITY_LO_INDEX, }; -static unsigned int pm8008_config_regs[] = { +static const unsigned int pm8008_config_regs[] = { INT_SET_TYPE_OFFSET, INT_POL_HIGH_OFFSET, INT_POL_LOW_OFFSET, @@ -129,7 +129,7 @@ static int pm8008_set_type_config(unsigned int **buf, unsigned int type, return 0; } -static struct regmap_irq_chip pm8008_irq_chip = { +static const struct regmap_irq_chip pm8008_irq_chip = { .name = "pm8008_irq", .main_status = I2C_INTR_STATUS_BASE, .num_main_regs = 1, From patchwork Sat Jun 8 15:55:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691033 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0041D1791ED; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=GUq3dkrh38ARId/qAk9WwTneheu0QSK6+aC0DunO0PyEJ7Lyg4jl/jOA6QRM0gSn/bseYZTWM3gDa2g62sobR0jnd6H/EHub58xfDPr1t5K27uBTwCAiZqRuXRunWTHtGADNUHSDBO2Pov/tLP2spystcp3Kmkvpmv2QITEHED4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=ktUgF/6UawgynxPPaqC7L5uMYlNVYYch3qE9zi0eRhM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k3ALVeOvsYOWq/jYNhqQ0X4Swj3EnK/in5tBQCLAkM32uLkBoA93ZiU/eCaAVd8R/2bx4+xkUYHgMo8naUrLyHKeUwJu09EABOIbElrYIW15eKJgotizqjwBb/DS/9NdG6rryhsnR/lFYNdTZbtuBGTLFSi431gvh/MtyXpjta0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c8Kx/67m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c8Kx/67m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 906B8C32781; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=ktUgF/6UawgynxPPaqC7L5uMYlNVYYch3qE9zi0eRhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c8Kx/67mQ4wUCl7rXwXfaCaLc45KWHJ4226e8gOj+s9y89rkEqJPDaCaEuBTwIFN2 TBb4koGCKrLNbytlME6SOgPocFDkm3x3RB7AkH8NLZPXHiMzu0ULFFBzmT+uzuWP2J WyVKWxGPsf7F3nwnA0rkYgydSMPnygpgoiviiz0Dl2txOj83AkwgAZBpQakn16h2Gw 9zt2Nd7XrawCKncciiuKyPcczPmWPCP2maL+mDnr1FqR1sdvvqxhBFAYBgPMZ0TTk7 eAYTBRTfmkJfZFRjaCpWVyENyu1eRCluewsQKv31FbrR4JTji/5xgSCWfAgVBgOvV7 AkkLgMbaDS+jw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRT-000000003Q1-3pE5; Sat, 08 Jun 2024 17:57:19 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 05/12] mfd: pm8008: Use lower case hex notation Date: Sat, 8 Jun 2024 17:55:19 +0200 Message-ID: <20240608155526.12996-6-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use lower case hex notation for consistency. Reviewed-by: Bryan O'Donoghue Reviewed-by: Stephen Boyd Signed-off-by: Johan Hovold --- drivers/mfd/qcom-pm8008.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index ab55d524c27b..18173c7a7e7b 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -38,8 +38,8 @@ enum { #define PM8008_PERIPH_0_BASE 0x900 #define PM8008_PERIPH_1_BASE 0x2400 -#define PM8008_PERIPH_2_BASE 0xC000 -#define PM8008_PERIPH_3_BASE 0xC100 +#define PM8008_PERIPH_2_BASE 0xc000 +#define PM8008_PERIPH_3_BASE 0xc100 #define PM8008_TEMP_ALARM_ADDR PM8008_PERIPH_1_BASE #define PM8008_GPIO1_ADDR PM8008_PERIPH_2_BASE @@ -151,7 +151,7 @@ static const struct regmap_irq_chip pm8008_irq_chip = { static struct regmap_config qcom_mfd_regmap_cfg = { .reg_bits = 16, .val_bits = 8, - .max_register = 0xFFFF, + .max_register = 0xffff, }; static int pm8008_probe(struct i2c_client *client) From patchwork Sat Jun 8 15:55:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691041 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 63FCF17B4EC; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=Z6tUhhIpJ7X1fOsu3tmsWG8Oc7nYMJu6NjzW5D3ZfkmVAFa73fLuX8RdsJS37EWvJpY4KFUpKE+bQ6UjJoUW8mkOOkqJ54bZqAFfQJUIMTQQ2fMO/r8ZeenmOjbS2Sk+QgDezU1Od3C6Cnzz06kiugES7jD43GjIuLJfRf7sFtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=lga3d+eXyDGzWJge8vvnwfcv1gyBqqWJmkYtkVpaX6M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Pd5lToeKxwJI5oJmwJ8QmqVuogL7V5D33PXeZEqssVW4kJFm4z0IT5hjlWn2noCRa1NjPqhH/Q+6BCTd0pnurNA3FPbO5iuLhOtDRlpujQmWXDmfodnurHqJBzA86lugHBzZY2ZtwACPZGMrJEgvqKIgBH9iuYtuTnIugGXaos0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RNBGcX2T; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RNBGcX2T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97B97C4AF0A; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=lga3d+eXyDGzWJge8vvnwfcv1gyBqqWJmkYtkVpaX6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RNBGcX2TjpqViRONTdOjfZ+TDAqfR/AyiALbCvbv7g4dgLWJqMDQG/7h3vWMTLV75 RoHTz3DbMmLJ5YIPs84wVA6K5OTXBXoUVi3g0itoxg+pkaXtBRmi9WqGQqzHKtgONG PAdib/OIpmwAxzlFiRe4SQ9K6QFimDger8z/9xyKL/7DXFVnD03ZhHzjqVSWVopPZY nDPlVdDlvpZoxImhDDB+kmvwThZ5JZX19+V1CmKe6otXnxaK8WqlE9JnAduWaxPI0x 7EUc1YqQmfa5uwQeKqOY8K2YwaERQW8soipbvYdH9won9vwaB/SqxZolMq1EI9O6Oe ZofGNdv6FfKwg== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRT-000000003Q3-49fK; Sat, 08 Jun 2024 17:57:20 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 06/12] mfd: pm8008: Rename irq chip Date: Sat, 8 Jun 2024 17:55:20 +0200 Message-ID: <20240608155526.12996-7-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Drop the redundant "irq" suffix from the irq chip name. Reviewed-by: Bryan O'Donoghue Reviewed-by: Stephen Boyd Signed-off-by: Johan Hovold --- drivers/mfd/qcom-pm8008.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index 18173c7a7e7b..bab17417aeec 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -130,7 +130,7 @@ static int pm8008_set_type_config(unsigned int **buf, unsigned int type, } static const struct regmap_irq_chip pm8008_irq_chip = { - .name = "pm8008_irq", + .name = "pm8008", .main_status = I2C_INTR_STATUS_BASE, .num_main_regs = 1, .irqs = pm8008_irqs, From patchwork Sat Jun 8 15:55:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691042 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 73D3917B500; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=inefgA0rBw9kk/cyg6SJHB8/ZOpWa9EM/DmrzxZx/N5keEK3bYOPv4k1ozdGg5HzZ7eNbC/v1HS8fqB2laoY1QDpTgaznCluzgcrVoR8Hw3u+rpa5h8I217Q9iD0iidRkMTFW6w7u4GczFSi+Qkrbr5na25PdiyAqjhIIlmiCPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=9D6ySfgbWhQOFK6PfMLujLLbbQCJ9ljTc4OjiKugm44=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t6JFGLpL9T5BG71NUnlzJ1lRDG9/Qx0HibPUP9gFpOxYneSbYpvBPGCT43Kr83U8+Trm1M1GOG7mA7rbXDMHOkmuP7Ok4692sFxhxuAhlRDxSGEXyNqHZETtkaB4OPgBzxW1ZFkj/HYeJUY1HaA3TOTamse+CRb+z4Gj87ZLsY4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vA/5X68/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vA/5X68/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CDE9C4AF0D; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=9D6ySfgbWhQOFK6PfMLujLLbbQCJ9ljTc4OjiKugm44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vA/5X68/2Z7CaJ03EsbxXgLsnwaatwI5YtaEvxnw4Lo1Oj5ubpSO8UVv1c3wWyPbr Tm2uvO78vdLtpdubiWBaPT0oeTUlXqbV/Vv0Lg++htj1i/Ck1aLIZm7D7OY+UJiA7E MiJV1JntjhX0FbrQ8EznjFo4pwX8jgtj6b3OAMoficBKmiCmVg3rviguRmISHhC9FM NGbBHDvxNL+TdKGWDBNenS05wSvnoK/0SEbSAAWvDSUMlME7jGktvlecXwgo8XpPCM 7L2WF0UlpCGGSkEoDd5UISbRhqwIBlpqXhAhp8OHcy2P9P3Wzi15mogWTFeifQePIU l8MyIeTWSMCBg== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRU-000000003Q5-0KoV; Sat, 08 Jun 2024 17:57:20 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 07/12] mfd: pm8008: Drop unused driver data Date: Sat, 8 Jun 2024 17:55:21 +0200 Message-ID: <20240608155526.12996-8-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The i2c client driver data pointer has never been used so drop the unnecessary assignment. Reviewed-by: Bryan O'Donoghue Reviewed-by: Stephen Boyd Signed-off-by: Johan Hovold --- drivers/mfd/qcom-pm8008.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index bab17417aeec..72199840231e 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -167,8 +167,6 @@ static int pm8008_probe(struct i2c_client *client) if (IS_ERR(regmap)) return PTR_ERR(regmap); - i2c_set_clientdata(client, regmap); - reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(reset)) return PTR_ERR(reset); From patchwork Sat Jun 8 15:55:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691039 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5169017B410; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=s+CC1STbyAFLjoVKkLwdf7e4uGxLFWX8XNw1LVVgtJh3Zm71boc19u39p124/qA0CracUtmTi+e2KC4B+1oEIK2FtR9osQ3CdsJ16lDHcjCGPTQB3pBr24f4mwNfXFYXf5a6Nx7Ef6hYwpmWc8bgZ/yrmdgV0JjKbLdlZrZDPYc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=1PVqbSEdTjzNUNtNb5nVf+8za+2HVUfuQBw5ji4FkkQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oBVpjGGLbkX+InmZLyu9EOGjqHCQENTyE8VYigQOMId9cuXstCMogckvM3aPwrkvktxs5AvEtwc3AQZbdKV1lri8o1nSSV6O6c0his99kXfjRcqp4NSGLaaSLM4vOUGfoTs2j7hPLlliIdE67P1gWl7I3WFoO1cFhtH3iOoWI9c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JkGEdCKK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JkGEdCKK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4801C4AF0E; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=1PVqbSEdTjzNUNtNb5nVf+8za+2HVUfuQBw5ji4FkkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JkGEdCKKaAxXwMSPoCmHPOgQWdxzjHOD/26D2+dOnwpJEjcR/xulIhLDzG/sbt3dC GVQYF35B7AVDJ4QwsnvdO/OoSO6B1AGD4rVbolR4XiIieJ1ib13eIiCuziGnW8In/m RYy/9r2POv1kNQDZBV8LXqO91Dh/QT5B6V0hNOr5zxEy1e/hjSieEhWPjTyqmGGTtS KvWBolM5e3XPoCDr47lLmk+BqRlce+XaUydHO8CFeIxJwRFTYARsEqm5jfegXl8JJV JWlWa/I+V/iGgUiNEQiwsab0M+nkcn4FAkaN4FCqpiRNrieLabSaVYN83llNL7Uwl7 yzmU0X8QBf9aA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRU-000000003Q8-0hto; Sat, 08 Jun 2024 17:57:20 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 08/12] dt-bindings: mfd: pm8008: Drop redundant descriptions Date: Sat, 8 Jun 2024 17:55:22 +0200 Message-ID: <20240608155526.12996-9-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In preparation for reworking the binding, drop the redundant descriptions of the standard 'reg' and 'interrupts' properties. Reviewed-by: Rob Herring (Arm) Signed-off-by: Johan Hovold --- Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml index e1e05921afb4..d71657f488db 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml @@ -19,16 +19,11 @@ properties: const: qcom,pm8008 reg: - description: - I2C slave address. - maxItems: 1 interrupts: maxItems: 1 - description: Parent interrupt. - reset-gpios: maxItems: 1 From patchwork Sat Jun 8 15:55:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691038 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5790C17B423; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=UY6vrrnzoVficyCGK3+lv7SPve33J+JWXb4SHOloXIroIFtzFS8Oq0YG8GgC5aOTjhv77VYf6htnDIeEumMjiFWWvkkOWFT1ALQkjP1AUPK1836pNCwN6pVWDXa1RzyGh4P2BkBuzsoCjnp0wHFU6/VMbhIggn+zHkiSY98J+rg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=A+xExKU+oPZGcncBlPzW/LTT+ijy3dTQcw/wRTkPK6Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nHD68jahZ0ZzkzwZnoNHZaag0MeZDLu/IT6nz5K6A7cX4EOMWUUCxXnsfb2DEn/ud2u4krEmkZdQ9UFtCR9YnuRyj7ToLgO6T/ZXK/tBxMO00u+irK7FwoVx+b1pRGASyNz77R6wIt3HVRkPuYVifbw7phBb0JoyjyyGDHAlDbE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bDTpz8c2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bDTpz8c2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6289C4AF4D; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=A+xExKU+oPZGcncBlPzW/LTT+ijy3dTQcw/wRTkPK6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bDTpz8c2+vFsft9p/oX0QKa8QQBumyVgFkOWa1QLeE7k8ioJyKSDdROajuLP11QLz LoZFyRC4swrwtgy2NJ9TYfDHPb6idzfh3jFJ6yrOx9jd2BJ3ba9E7uImg7BTK07XTf MNGj/I9jzp2qFckHT0jAmJWD4zBRTVsExPmIW37xFB+pa1bbZ15edumiMx+1CepFvj bnhk1K6JYJSY3MX+bUXSnHmlRTDCtP0Z/9tmP+6sqkN+HbuGjrY8CO1yOXOZjsJSO7 gL8ekdu3DJrCryDA0BRzfsVNs5SjZ5eRDeBOLL6NoBvq1DwyDMy/khlbjZG2EtItp+ ntzik3v4eryyQ== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRU-000000003QA-18FM; Sat, 08 Jun 2024 17:57:20 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 09/12] dt-bindings: mfd: pm8008: Rework binding Date: Sat, 8 Jun 2024 17:55:23 +0200 Message-ID: <20240608155526.12996-10-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Rework the pm8008 binding, which is currently unused, by dropping internal details like register offsets and interrupts and by adding the missing regulator and temperature alarm properties. Note that child nodes are still used for pinctrl and regulator configuration. Also note that the pinctrl state definition will be extended later and could eventually also be shared with other PMICs (e.g. by breaking out bits of qcom,pmic-gpio.yaml). Signed-off-by: Johan Hovold Reviewed-by: Rob Herring (Arm) --- .../devicetree/bindings/mfd/qcom,pm8008.yaml | 135 +++++++++++------- 1 file changed, 80 insertions(+), 55 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml index d71657f488db..0c6e1870db1d 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml @@ -27,103 +27,128 @@ properties: reset-gpios: maxItems: 1 - "#interrupt-cells": + vdd-l1-l2-supply: true + vdd-l3-l4-supply: true + vdd-l5-supply: true + vdd-l6-supply: true + vdd-l7-supply: true + + gpio-controller: true + + "#gpio-cells": const: 2 - description: | - The first cell is the IRQ number, the second cell is the IRQ trigger - flag. All interrupts are listed in include/dt-bindings/mfd/qcom-pm8008.h. + gpio-ranges: + maxItems: 1 interrupt-controller: true - "#address-cells": - const: 1 + "#interrupt-cells": + const: 2 - "#size-cells": + "#thermal-sensor-cells": const: 0 -patternProperties: - "^gpio@[0-9a-f]+$": + pinctrl: type: object + additionalProperties: false + patternProperties: + "-state$": + type: object - description: | - The GPIO peripheral. This node may be specified twice, one for each GPIO. - - properties: - compatible: - items: - - const: qcom,pm8008-gpio - - const: qcom,spmi-gpio - - reg: - description: Peripheral address of one of the two GPIO peripherals. - maxItems: 1 - - gpio-controller: true - - gpio-ranges: - maxItems: 1 + allOf: + - $ref: /schemas/pinctrl/pinmux-node.yaml + - $ref: /schemas/pinctrl/pincfg-node.yaml - interrupt-controller: true + properties: + pins: + items: + pattern: "^gpio[12]$" - "#interrupt-cells": - const: 2 + function: + items: + - enum: + - normal - "#gpio-cells": - const: 2 + required: + - pins + - function - required: - - compatible - - reg - - gpio-controller - - interrupt-controller - - "#gpio-cells" - - gpio-ranges - - "#interrupt-cells" + additionalProperties: false + regulators: + type: object additionalProperties: false + patternProperties: + "^ldo[1-7]$": + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false required: - compatible - reg - interrupts - - "#address-cells" - - "#size-cells" + - vdd-l1-l2-supply + - vdd-l3-l4-supply + - vdd-l5-supply + - vdd-l6-supply + - vdd-l7-supply + - gpio-controller + - "#gpio-cells" + - gpio-ranges + - interrupt-controller - "#interrupt-cells" + - "#thermal-sensor-cells" additionalProperties: false examples: - | #include - #include #include i2c { #address-cells = <1>; #size-cells = <0>; - pmic@8 { + pm8008: pmic@8 { compatible = "qcom,pm8008"; reg = <0x8>; - #address-cells = <1>; - #size-cells = <0>; - interrupt-controller; - #interrupt-cells = <2>; interrupt-parent = <&tlmm>; interrupts = <32 IRQ_TYPE_EDGE_RISING>; reset-gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; - pm8008_gpios: gpio@c000 { - compatible = "qcom,pm8008-gpio", "qcom,spmi-gpio"; - reg = <0xc000>; - gpio-controller; - gpio-ranges = <&pm8008_gpios 0 0 2>; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; + vdd-l1-l2-supply = <&vreg_s8b_1p2>; + vdd-l3-l4-supply = <&vreg_s1b_1p8>; + vdd-l5-supply = <&vreg_bob>; + vdd-l6-supply = <&vreg_bob>; + vdd-l7-supply = <&vreg_bob>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pm8008 0 0 2>; + + interrupt-controller; + #interrupt-cells = <2>; + + #thermal-sensor-cells = <0>; + + pinctrl { + gpio-keys-state { + pins = "gpio1"; + function = "normal"; + }; + }; + + regulators { + ldo1 { + regulator-name = "vreg_l1"; + regulator-min-microvolt = <950000>; + regulator-max-microvolt = <1300000>; + }; }; }; }; From patchwork Sat Jun 8 15:55:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691043 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 73DA417B501; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=ZuC0OJgrEEGBUfCAX17+mlimpKPk9uGA2BhAWs9+5bzeNpL6Gzr/gH8+yiWTfbhj8LFGdo0L/Nq3C6CRGxDdMvMuijECCFX5sX33/Ysk2tPV4b2yK9HUV1sWeIMqXp31OVkheFTJhleauLw6B0K4/93pb8I1MVnXeMOy4AgtV98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=xuLW186fea6lJzbfge+RPFqnKTg2k2paCC0ZLWkIo8M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lp+P1Aa8whwpT/Gy0sUVgl5NHn7rFZ1PJTZOt0yLlTtRxeeZsyKDlXDZdqamVHYIBfuDhKY5ckY+IiU0CoAmzbwJSYres3AFfp+BzIgv6NDvFLdQl7v/S8xYBJPkT3N3RkWa+NBl04Dpw/GFquRPuh7dRQo/bmfBzhgS2TmGaQI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MFNDOOfK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MFNDOOfK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFDD6C4AF1D; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862241; bh=xuLW186fea6lJzbfge+RPFqnKTg2k2paCC0ZLWkIo8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MFNDOOfKmyk7wBhW7lAU2yXcx+5TU/EnYCQSr9hCGygcERkvrnmTJ3hhIY9Io3/dq MpCcWT9gAuwR2HbMDkPMu6sy4V/+vVOfneCAjLosB66N+zMRS14PXFME4zlko+Zrtj sC7+mgyyAy3KDwQjIJLylDjGM17WcesG7fZx5YBExuIUvkbDgnyZLC+6L0SNXowQad /FLWNhfyOSah64zdaBKgoj++E5z6ahktS8HLti7zwxLownp+emefx37kSLuctj8oNJ mt+wPca/11oixsUJsC8kQTVJaPg3cnrw28At1YH4rltwRvoTs2ommJLb21LJw7GQbb tTJ41yvIhhfng== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRU-000000003QF-1Ytt; Sat, 08 Jun 2024 17:57:20 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 10/12] mfd: pm8008: Rework to match new DT binding Date: Sat, 8 Jun 2024 17:55:24 +0200 Message-ID: <20240608155526.12996-11-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Rework the pm8008 driver to match the new devicetree binding which no longer describes internal details like interrupts and register offsets (including which of the two consecutive I2C addresses the registers belong to). Instead make the interrupt controller implementation internal and pass interrupts to the subdrivers using MFD cell resources. Note that subdrivers may either get their resources, like register block offsets, from the parent MFD or this can be included in the subdrivers directly. In the current implementation, the temperature alarm driver is generic enough to just get its base address and alarm interrupt from the parent driver, which already uses this information to implement the interrupt controller. The regulator driver, however, needs additional information like parent supplies and regulator characteristics so in that case it is easier to just augment its table with the regulator register base addresses. Similarly, the current GPIO driver already holds the number of pins and that lookup table can therefore also be extended with register offsets. Note that subdrivers can now access the two regmaps by name, even if the primary regmap is registered last so that it is returned by default when no name is provided in lookups. Finally, note that the temperature alarm and GPIO subdrivers need some minor rework before they can be used with non-SPMI devices like the PM8008. The temperature alarm MFD cell name specifically uses a "qpnp" rather than "spmi" prefix to prevent binding until the driver has been updated. Tested-by: Bryan O'Donoghue Signed-off-by: Johan Hovold --- drivers/mfd/Kconfig | 1 + drivers/mfd/qcom-pm8008.c | 97 +++++++++++++++++++++++---- include/dt-bindings/mfd/qcom-pm8008.h | 19 ------ 3 files changed, 86 insertions(+), 31 deletions(-) delete mode 100644 include/dt-bindings/mfd/qcom-pm8008.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 266b4f54af60..6b220dfea0a4 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -2208,6 +2208,7 @@ config MFD_ACER_A500_EC config MFD_QCOM_PM8008 tristate "QCOM PM8008 Power Management IC" depends on I2C && OF + select MFD_CORE select REGMAP_I2C select REGMAP_IRQ help diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index 72199840231e..246b5fe9819d 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -7,8 +7,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -16,8 +18,6 @@ #include #include -#include - #define I2C_INTR_STATUS_BASE 0x0550 #define INT_RT_STS_OFFSET 0x10 #define INT_SET_TYPE_OFFSET 0x11 @@ -45,6 +45,16 @@ enum { #define PM8008_GPIO1_ADDR PM8008_PERIPH_2_BASE #define PM8008_GPIO2_ADDR PM8008_PERIPH_3_BASE +/* PM8008 IRQ numbers */ +#define PM8008_IRQ_MISC_UVLO 0 +#define PM8008_IRQ_MISC_OVLO 1 +#define PM8008_IRQ_MISC_OTST2 2 +#define PM8008_IRQ_MISC_OTST3 3 +#define PM8008_IRQ_MISC_LDO_OCP 4 +#define PM8008_IRQ_TEMP_ALARM 5 +#define PM8008_IRQ_GPIO1 6 +#define PM8008_IRQ_GPIO2 7 + enum { SET_TYPE_INDEX, POLARITY_HI_INDEX, @@ -148,21 +158,65 @@ static const struct regmap_irq_chip pm8008_irq_chip = { .get_irq_reg = pm8008_get_irq_reg, }; -static struct regmap_config qcom_mfd_regmap_cfg = { +static const struct regmap_config qcom_mfd_regmap_cfg = { + .name = "primary", + .reg_bits = 16, + .val_bits = 8, + .max_register = 0xffff, +}; + +static const struct regmap_config pm8008_regmap_cfg_2 = { + .name = "secondary", .reg_bits = 16, .val_bits = 8, .max_register = 0xffff, }; +static const struct resource pm8008_temp_res[] = { + DEFINE_RES_MEM(PM8008_TEMP_ALARM_ADDR, 0x100), + DEFINE_RES_IRQ(PM8008_IRQ_TEMP_ALARM), +}; + +static const struct mfd_cell pm8008_cells[] = { + MFD_CELL_NAME("pm8008-regulator"), + MFD_CELL_RES("qpnp-temp-alarm", pm8008_temp_res), + MFD_CELL_NAME("pm8008-gpio"), +}; + +static void devm_irq_domain_fwnode_release(void *data) +{ + struct fwnode_handle *fwnode = data; + + irq_domain_free_fwnode(fwnode); +} + static int pm8008_probe(struct i2c_client *client) { struct regmap_irq_chip_data *irq_data; + struct device *dev = &client->dev; + struct regmap *regmap, *regmap2; + struct fwnode_handle *fwnode; + struct i2c_client *dummy; struct gpio_desc *reset; - int rc; - struct device *dev; - struct regmap *regmap; + char *name; + int ret; + + dummy = devm_i2c_new_dummy_device(dev, client->adapter, client->addr + 1); + if (IS_ERR(dummy)) { + ret = PTR_ERR(dummy); + dev_err(dev, "failed to claim second address: %d\n", ret); + return ret; + } + + regmap2 = devm_regmap_init_i2c(dummy, &qcom_mfd_regmap_cfg); + if (IS_ERR(regmap2)) + return PTR_ERR(regmap2); - dev = &client->dev; + ret = regmap_attach_dev(dev, regmap2, &pm8008_regmap_cfg_2); + if (ret) + return ret; + + /* Default regmap must be attached last. */ regmap = devm_regmap_init_i2c(client, &qcom_mfd_regmap_cfg); if (IS_ERR(regmap)) return PTR_ERR(regmap); @@ -177,14 +231,33 @@ static int pm8008_probe(struct i2c_client *client) */ usleep_range(1000, 2000); - if (of_property_read_bool(dev->of_node, "interrupt-controller")) { - rc = devm_regmap_add_irq_chip(dev, regmap, client->irq, + name = devm_kasprintf(dev, GFP_KERNEL, "%pOF-internal", dev->of_node); + if (!name) + return -ENOMEM; + + name = strreplace(name, '/', ':'); + + fwnode = irq_domain_alloc_named_fwnode(name); + if (!fwnode) + return -ENOMEM; + + ret = devm_add_action_or_reset(dev, devm_irq_domain_fwnode_release, fwnode); + if (ret) + return ret; + + ret = devm_regmap_add_irq_chip_fwnode(dev, fwnode, regmap, client->irq, IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data); - if (rc) - dev_err(dev, "failed to add IRQ chip: %d\n", rc); + if (ret) { + dev_err(dev, "failed to add IRQ chip: %d\n", ret); + return ret; } - return devm_of_platform_populate(dev); + /* Needed by GPIO driver. */ + dev_set_drvdata(dev, regmap_irq_get_domain(irq_data)); + + return devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, pm8008_cells, + ARRAY_SIZE(pm8008_cells), NULL, 0, + regmap_irq_get_domain(irq_data)); } static const struct of_device_id pm8008_match[] = { diff --git a/include/dt-bindings/mfd/qcom-pm8008.h b/include/dt-bindings/mfd/qcom-pm8008.h deleted file mode 100644 index eca9448df228..000000000000 --- a/include/dt-bindings/mfd/qcom-pm8008.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright (c) 2021 The Linux Foundation. All rights reserved. - */ - -#ifndef __DT_BINDINGS_MFD_QCOM_PM8008_H -#define __DT_BINDINGS_MFD_QCOM_PM8008_H - -/* PM8008 IRQ numbers */ -#define PM8008_IRQ_MISC_UVLO 0 -#define PM8008_IRQ_MISC_OVLO 1 -#define PM8008_IRQ_MISC_OTST2 2 -#define PM8008_IRQ_MISC_OTST3 3 -#define PM8008_IRQ_MISC_LDO_OCP 4 -#define PM8008_IRQ_TEMP_ALARM 5 -#define PM8008_IRQ_GPIO1 6 -#define PM8008_IRQ_GPIO2 7 - -#endif From patchwork Sat Jun 8 15:55:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691044 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 80C8117B509; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=J4u+4nGZU92eAeHPMl0F9hvbRuTWo5EHl0hCm/DpfBXKUpdxU4EqizB879KiS5HnxeZJHVSD5tAXGd6z3ep3korIxxeU98rKu4Hww7t8S3BDfdBu4Ohu0awGuu5MzhjA4ze29RoOOV0Y2/HWFgIrsXukibVjlX+Mu9ALNGaZCCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=FABEpCe24JF/PgXM52d8nESFlQ8kRAjjKIYs6XXOQqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=enflSWI3B5QlypPeT/g7Yn7KSxL6gnRi4EE4gGiyQ+WUMhOIoci+6kGKdGYX2z9OKWc1WhwzTEQNnGW7d18OKxahEv9pGp6zPU2hFt98NxOfvMIz87f+RSANXP/dJuuqpn/ebcapa7rwFSGooqe68ZpdtSxXHJDl+ueXUyw8qi8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bheiluEM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bheiluEM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEABEC4DDF0; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862241; bh=FABEpCe24JF/PgXM52d8nESFlQ8kRAjjKIYs6XXOQqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bheiluEMmSBwv3rrGLdIFq2ltrc7rxr59pFJJUPr09ZFxQ316tpTxdcrpVcekyTd+ 3I2rZX1L2ck7UPxOpbbY5bzKRP7bUvl8u3gKwEgz3IPouJSov9XHCWGMbtMYpo8WAi f9uFKC97OkOv6gaOC1wr/ac7+cL/DQhV8HSuaVAaq7ZJa+ziZN8teK+qR6GxTu9R4G HTYGELUHiaOW+M/wohUUr+PmDI4Goc9FbroABQGYmRmhdItyuwNLjTIrai+ORZHOLz B0xaTmiAl+YHmQJrAlmdqWMbjieAbxXoSfPucpO29jJ4k1gNpyJjuiA1ngRcx0rNhc yOXLD/S2TzR7Q== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRU-000000003QI-1z0X; Sat, 08 Jun 2024 17:57:20 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 11/12] regulator: add pm8008 pmic regulator driver Date: Sat, 8 Jun 2024 17:55:25 +0200 Message-ID: <20240608155526.12996-12-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The Qualcomm PM8008 is an I2C-controlled PMIC containing seven LDO regulators. The driver is based on a driver submitted by Satya Priya, but it has been cleaned up and reworked to match the new devicetree binding which no longer describes each regulator as a separate device. This avoids describing internal details like register offsets in the devicetree and allows for extending the implementation with features like over-current protection without having to update the binding. Specifically note that the regulator interrupts are shared between all regulators. Note that the secondary regmap is looked up by name and that if the driver ever needs to be generalised to support regulators provided by the primary regmap (I2C address) such information could be added to the device-id table. This also fixes the original implementation, which looked up regulators by 'regulator-name' property rather than devicetree node name and which prevented the regulators from being named to match board schematics. Link: https://lore.kernel.org/r/1655200111-18357-8-git-send-email-quic_c_skakit@quicinc.com Cc: Satya Priya Kakitapalli Cc: Stephen Boyd Reviewed-by: Mark Brown Signed-off-by: Johan Hovold Reviewed-by: Mark Brown --- drivers/regulator/Kconfig | 7 + drivers/regulator/Makefile | 1 + drivers/regulator/qcom-pm8008-regulator.c | 198 ++++++++++++++++++++++ 3 files changed, 206 insertions(+) create mode 100644 drivers/regulator/qcom-pm8008-regulator.c diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index d333be2bea3b..17982e1cbf4d 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -1027,6 +1027,13 @@ config REGULATOR_PWM This driver supports PWM controlled voltage regulators. PWM duty cycle can increase or decrease the voltage. +config REGULATOR_QCOM_PM8008 + tristate "Qualcomm PM8008 PMIC regulators" + depends on MFD_QCOM_PM8008 + help + Select this option to enable support for the voltage regulators in + Qualcomm PM8008 PMICs. + config REGULATOR_QCOM_REFGEN tristate "Qualcomm REFGEN regulator driver" depends on ARCH_QCOM || COMPILE_TEST diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index ba15fa5f30ad..ca4d09c60867 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -112,6 +112,7 @@ obj-$(CONFIG_REGULATOR_MT6380) += mt6380-regulator.o obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o obj-$(CONFIG_REGULATOR_MTK_DVFSRC) += mtk-dvfsrc-regulator.o obj-$(CONFIG_REGULATOR_QCOM_LABIBB) += qcom-labibb-regulator.o +obj-$(CONFIG_REGULATOR_QCOM_PM8008) += qcom-pm8008-regulator.o obj-$(CONFIG_REGULATOR_QCOM_REFGEN) += qcom-refgen-regulator.o obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o obj-$(CONFIG_REGULATOR_QCOM_RPMH) += qcom-rpmh-regulator.o diff --git a/drivers/regulator/qcom-pm8008-regulator.c b/drivers/regulator/qcom-pm8008-regulator.c new file mode 100644 index 000000000000..da017c1969d0 --- /dev/null +++ b/drivers/regulator/qcom-pm8008-regulator.c @@ -0,0 +1,198 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2024 Linaro Limited + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define DEFAULT_VOLTAGE_STEPPER_RATE 38400 + +#define LDO_STEPPER_CTL_REG 0x3b +#define STEP_RATE_MASK GENMASK(1, 0) + +#define LDO_VSET_LB_REG 0x40 + +#define LDO_ENABLE_REG 0x46 +#define ENABLE_BIT BIT(7) + +struct pm8008_regulator { + struct regmap *regmap; + struct regulator_desc desc; + unsigned int base; +}; + +struct pm8008_regulator_data { + const char *name; + const char *supply_name; + unsigned int base; + int min_dropout_uV; + const struct linear_range *voltage_range; +}; + +static const struct linear_range nldo_ranges[] = { + REGULATOR_LINEAR_RANGE(528000, 0, 122, 8000), +}; + +static const struct linear_range pldo_ranges[] = { + REGULATOR_LINEAR_RANGE(1504000, 0, 237, 8000), +}; + +static const struct pm8008_regulator_data pm8008_reg_data[] = { + { "ldo1", "vdd-l1-l2", 0x4000, 225000, nldo_ranges, }, + { "ldo2", "vdd-l1-l2", 0x4100, 225000, nldo_ranges, }, + { "ldo3", "vdd-l3-l4", 0x4200, 300000, pldo_ranges, }, + { "ldo4", "vdd-l3-l4", 0x4300, 300000, pldo_ranges, }, + { "ldo5", "vdd-l5", 0x4400, 200000, pldo_ranges, }, + { "ldo6", "vdd-l6", 0x4500, 200000, pldo_ranges, }, + { "ldo7", "vdd-l7", 0x4600, 200000, pldo_ranges, }, +}; + +static int pm8008_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel) +{ + struct pm8008_regulator *preg = rdev_get_drvdata(rdev); + unsigned int mV; + __le16 val; + int ret; + + ret = regulator_list_voltage_linear_range(rdev, sel); + if (ret < 0) + return ret; + + mV = DIV_ROUND_UP(ret, 1000); + + val = cpu_to_le16(mV); + + ret = regmap_bulk_write(preg->regmap, preg->base + LDO_VSET_LB_REG, + &val, sizeof(val)); + if (ret < 0) + return ret; + + return 0; +} + +static int pm8008_regulator_get_voltage_sel(struct regulator_dev *rdev) +{ + struct pm8008_regulator *preg = rdev_get_drvdata(rdev); + unsigned int uV; + __le16 val; + int ret; + + ret = regmap_bulk_read(preg->regmap, preg->base + LDO_VSET_LB_REG, + &val, sizeof(val)); + if (ret < 0) + return ret; + + uV = le16_to_cpu(val) * 1000; + + return (uV - preg->desc.min_uV) / preg->desc.uV_step; +} + +static const struct regulator_ops pm8008_regulator_ops = { + .list_voltage = regulator_list_voltage_linear, + .set_voltage_sel = pm8008_regulator_set_voltage_sel, + .get_voltage_sel = pm8008_regulator_get_voltage_sel, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, +}; + +static int pm8008_regulator_probe(struct platform_device *pdev) +{ + const struct pm8008_regulator_data *data; + struct regulator_config config = {}; + struct device *dev = &pdev->dev; + struct pm8008_regulator *preg; + struct regulator_desc *desc; + struct regulator_dev *rdev; + struct regmap *regmap; + unsigned int val; + int ret, i; + + regmap = dev_get_regmap(dev->parent, "secondary"); + if (!regmap) + return -EINVAL; + + for (i = 0; i < ARRAY_SIZE(pm8008_reg_data); i++) { + data = &pm8008_reg_data[i]; + + preg = devm_kzalloc(dev, sizeof(*preg), GFP_KERNEL); + if (!preg) + return -ENOMEM; + + preg->regmap = regmap; + preg->base = data->base; + + desc = &preg->desc; + + desc->name = data->name; + desc->supply_name = data->supply_name; + desc->of_match = data->name; + desc->regulators_node = of_match_ptr("regulators"); + desc->ops = &pm8008_regulator_ops; + desc->type = REGULATOR_VOLTAGE; + desc->owner = THIS_MODULE; + + desc->linear_ranges = data->voltage_range; + desc->n_linear_ranges = 1; + desc->uV_step = desc->linear_ranges[0].step; + desc->min_uV = desc->linear_ranges[0].min; + desc->n_voltages = linear_range_values_in_range(&desc->linear_ranges[0]); + + ret = regmap_read(regmap, preg->base + LDO_STEPPER_CTL_REG, &val); + if (ret < 0) { + dev_err(dev, "failed to read step rate: %d\n", ret); + return ret; + } + val &= STEP_RATE_MASK; + desc->ramp_delay = DEFAULT_VOLTAGE_STEPPER_RATE >> val; + + desc->min_dropout_uV = data->min_dropout_uV; + + desc->enable_reg = preg->base + LDO_ENABLE_REG; + desc->enable_mask = ENABLE_BIT; + + config.dev = dev->parent; + config.driver_data = preg; + config.regmap = regmap; + + rdev = devm_regulator_register(dev, desc, &config); + if (IS_ERR(rdev)) { + ret = PTR_ERR(rdev); + dev_err(dev, "failed to register regulator %s: %d\n", + desc->name, ret); + return ret; + } + } + + return 0; +} + +static const struct platform_device_id pm8008_regulator_id_table[] = { + { "pm8008-regulator" }, + { } +}; +MODULE_DEVICE_TABLE(platform, pm8008_regulator_id_table); + +static struct platform_driver pm8008_regulator_driver = { + .driver = { + .name = "qcom-pm8008-regulator", + }, + .probe = pm8008_regulator_probe, + .id_table = pm8008_regulator_id_table, +}; +module_platform_driver(pm8008_regulator_driver); + +MODULE_DESCRIPTION("Qualcomm PM8008 PMIC regulator driver"); +MODULE_LICENSE("GPL"); From patchwork Sat Jun 8 15:55:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13691045 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 80C3617B508; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=ub/nxln4oXzocKLCm9NYgaFNtRte2hufr3rC8YSVRLKImFskN5RL0IvIjN1Bq5WYGQXDmAqi1K/Q7UWuI9QJ3hsp3XDGpl3TR9+lc0/zf4R4XLzR02OWgcalTw/mRotq1YWW+qCbTvq8u+XIZjD38srIAgeAIGtdDyd6K/jrAoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=mrE9CflCyD5JGJU45JpmcouGaGOztDkM/lJ4oalLK0c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Frfs9URPqNh3cyDffZUYOaqJAoeBAMY9YjL/iKlQGnQhwtlchkNYiLoPXNQlCAX7QmZ3qf8T8u10BbMhCuaPoeaEGVTckJ80nEmmM2YHtcCx4TuymEGHdmlsmYhcvYnatOjQq3Z3E+u2pG01ppguYLxTJtReZBva4P4SZYqdkLI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oGxkhm4Y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oGxkhm4Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10A95C4DE00; Sat, 8 Jun 2024 15:57:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862241; bh=mrE9CflCyD5JGJU45JpmcouGaGOztDkM/lJ4oalLK0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oGxkhm4YIAttg9cFJNPyiFrl4ijOQsL6rfF0KwRw5jU1mDiWrWCwCzuCQrMoO5eaE KPr+719Jx14U6SK4/vpnlrNvSRKI0alg300+P0XM2WSWT9vqWub/6aylm0OC417psp e/ymxXVIA+KtjVcZJibDuxcoHWwS9Fw1IHS+ilwdYLA12NrytGF2P/dRN1UsUb8WAK vs8uKTH5q4fzREncAidWEFyuc+BnC5d/3xdzooIPSL8He+WJlqmMkzcoRyAxWKHUyO ZUXo1lItASsMG+zMOszCVF5WpzKnacEjd7AxbVAq968ue+LF6Lx7eqIO1fU4zC2yPW z3dfc2F9xjNkQ== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRU-000000003QN-2Rhf; Sat, 08 Jun 2024 17:57:20 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 12/12] arm64: dts: qcom: sc8280xp-x13s: enable pm8008 camera pmic Date: Sat, 8 Jun 2024 17:55:26 +0200 Message-ID: <20240608155526.12996-13-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Enable the PM8008 PMIC which is used to power the camera sensors. Reviewed-by: Bryan O'Donoghue Tested-by: Bryan O'Donoghue Signed-off-by: Johan Hovold Reviewed-by: Konrad Dybcio --- .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index 642705b7d896..daca6bd2e34c 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -297,6 +297,27 @@ linux,cma { }; thermal-zones { + pm8008-thermal { + polling-delay-passive = <100>; + polling-delay = <0>; + + thermal-sensors = <&pm8008>; + + trips { + trip0 { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + + trip1 { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + skin-temp-thermal { polling-delay-passive = <250>; polling-delay = <0>; @@ -671,6 +692,85 @@ touchscreen@10 { }; }; +&i2c11 { + clock-frequency = <400000>; + + pinctrl-names = "default"; + pinctrl-0 = <&i2c11_default>; + + status = "okay"; + + pm8008: pmic@c { + compatible = "qcom,pm8008"; + reg = <0xc>; + + interrupts-extended = <&tlmm 41 IRQ_TYPE_EDGE_RISING>; + reset-gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; + + vdd-l1-l2-supply = <&vreg_s11b>; + vdd-l3-l4-supply = <&vreg_bob>; + vdd-l5-supply = <&vreg_bob>; + vdd-l6-supply = <&vreg_bob>; + vdd-l7-supply = <&vreg_bob>; + + pinctrl-names = "default"; + pinctrl-0 = <&pm8008_default>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pm8008 0 0 2>; + + interrupt-controller; + #interrupt-cells = <2>; + + #thermal-sensor-cells = <0>; + + regulators { + vreg_l1q: ldo1 { + regulator-name = "vreg_l1q"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + }; + + vreg_l2q: ldo2 { + regulator-name = "vreg_l2q"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + }; + + vreg_l3q: ldo3 { + regulator-name = "vreg_l3q"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + + vreg_l4q: ldo4 { + regulator-name = "vreg_l4q"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + + vreg_l5q: ldo5 { + regulator-name = "vreg_l5q"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + vreg_l6q: ldo6 { + regulator-name = "vreg_l6q"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + vreg_l7q: ldo7 { + regulator-name = "vreg_l7q"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + }; + }; +}; + &i2c21 { clock-frequency = <400000>; @@ -1361,6 +1461,13 @@ i2c4_default: i2c4-default-state { bias-disable; }; + i2c11_default: i2c11-default-state { + pins = "gpio18", "gpio19"; + function = "qup11"; + drive-strength = <16>; + bias-disable; + }; + i2c21_default: i2c21-default-state { pins = "gpio81", "gpio82"; function = "qup21"; @@ -1464,6 +1571,22 @@ wake-n-pins { }; }; + pm8008_default: pm8008-default-state { + int-pins { + pins = "gpio41"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + reset-n-pins { + pins = "gpio42"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + }; + spkr_1_sd_n_default: spkr-1-sd-n-default-state { perst-n-pins { pins = "gpio178";