From patchwork Tue Jul 16 08:22:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734120 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 321F0C3DA49 for ; Tue, 16 Jul 2024 08:23:08 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5818.1721118180107077795 for ; Tue, 16 Jul 2024 01:23:01 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467674" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:01 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 8CA294005B53; Tue, 16 Jul 2024 17:22:59 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 01/31] mfd: core: Delete corresponding OF node entries from list on MFD removal Date: Tue, 16 Jul 2024 09:22:12 +0100 Message-ID: <20240716082255.56551-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:08 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16527 From: Michal Oleszczyk commit 8e88c61d6f3432f27a2c6b8bc58ae4fe974f4b6d upstream. When we consider MFD which implements hotplug (e.g. USB hotplug driver based on product and vendor IDs) functionality it turns out that its sub-devices are correctly matched with corresponding device tree nodes only at the first time. When physical device reboots or is replugged (and MFD driver is disconnected and probed back again) all sub-devices fails in mfd_add_device() with error 'Failed to locate of_node'. The reason of that behavior is that when any MFD sub-device is created for the first time (and matched with device tree node) it is added to the mfd_of_node_list. It looks like this list is never cleaned even if devices added there are intentionally removed from the system. So when MFD device is replugged and all sub-devices are matched with their device tree nodes again they fail as matched nodes already exist in mfd_of_node_list. In other words current implementation does not support MFD with hotplug feature. This commit extends MFD core for hotplugging support by removing appropriate OF node entry from mfd_of_node_list when corresponding device is removed from the system. Thanks to that when device is added once again it can be matched with its device tree node successfully. Signed-off-by: Michal Oleszczyk Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220809060336.31892-1-m.oleszczyk@grinn-global.com [biju: Same behaviour during bind/unbind] Signed-off-by: Biju Das --- drivers/mfd/mfd-core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index c0083e38d527..e81128143b5b 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -367,6 +367,7 @@ static int mfd_remove_devices_fn(struct device *dev, void *data) { struct platform_device *pdev; const struct mfd_cell *cell; + struct mfd_of_node_entry *of_entry, *tmp; int *level = data; if (dev->type != &mfd_dev_type) @@ -378,6 +379,12 @@ static int mfd_remove_devices_fn(struct device *dev, void *data) if (level && cell->level > *level) return 0; + list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list) + if (of_entry->dev == &pdev->dev) { + list_del(&of_entry->list); + kfree(of_entry); + } + regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies, cell->num_parent_supplies); From patchwork Tue Jul 16 08:22:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734122 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33C75C41513 for ; Tue, 16 Jul 2024 08:23:08 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5927.1721118184270232470 for ; Tue, 16 Jul 2024 01:23:04 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215425972" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:03 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id C74654005B53; Tue, 16 Jul 2024 17:23:01 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 02/31] mfd: da9xxx-core: Constify static struct resource Date: Tue, 16 Jul 2024 09:22:13 +0100 Message-ID: <20240716082255.56551-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:08 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16528 From: Rikard Falkeborn commit a0fa0abeb508360bea82a84ce83aea49769641d3 upstream. Constify a number of static struct resource. The only usage of the structs are to assign their address to the resources field in the mfd_cell struct. This allows the compiler to put them in read-only memory. Done with the help of Coccinelle. Signed-off-by: Rikard Falkeborn Acked-by: Adam Thomson Signed-off-by: Lee Jones Signed-off-by: Biju Das --- drivers/mfd/da9055-core.c | 8 ++++---- drivers/mfd/da9062-core.c | 24 ++++++++++++------------ drivers/mfd/da9063-core.c | 8 ++++---- drivers/mfd/da9150-core.c | 6 +++--- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/mfd/da9055-core.c b/drivers/mfd/da9055-core.c index 6d0af8486269..d074d213e661 100644 --- a/drivers/mfd/da9055-core.c +++ b/drivers/mfd/da9055-core.c @@ -254,14 +254,14 @@ const struct regmap_config da9055_regmap_config = { }; EXPORT_SYMBOL_GPL(da9055_regmap_config); -static struct resource da9055_onkey_resource = { +static const struct resource da9055_onkey_resource = { .name = "ONKEY", .start = DA9055_IRQ_NONKEY, .end = DA9055_IRQ_NONKEY, .flags = IORESOURCE_IRQ, }; -static struct resource da9055_rtc_resource[] = { +static const struct resource da9055_rtc_resource[] = { { .name = "ALM", .start = DA9055_IRQ_ALARM, @@ -276,14 +276,14 @@ static struct resource da9055_rtc_resource[] = { }, }; -static struct resource da9055_hwmon_resource = { +static const struct resource da9055_hwmon_resource = { .name = "HWMON", .start = DA9055_IRQ_HWMON, .end = DA9055_IRQ_HWMON, .flags = IORESOURCE_IRQ, }; -static struct resource da9055_ld05_6_resource = { +static const struct resource da9055_ld05_6_resource = { .name = "REGULATOR", .start = DA9055_IRQ_REGULATOR, .end = DA9055_IRQ_REGULATOR, diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index fc30726e2e27..9583a98d3aae 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -160,23 +160,23 @@ static struct regmap_irq_chip da9062_irq_chip = { .ack_base = DA9062AA_EVENT_A, }; -static struct resource da9061_core_resources[] = { +static const struct resource da9061_core_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_VDD_WARN, "VDD_WARN"), }; -static struct resource da9061_regulators_resources[] = { +static const struct resource da9061_regulators_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_LDO_LIM, "LDO_LIM"), }; -static struct resource da9061_thermal_resources[] = { +static const struct resource da9061_thermal_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_TEMP, "THERMAL"), }; -static struct resource da9061_wdt_resources[] = { +static const struct resource da9061_wdt_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_WDG_WARN, "WD_WARN"), }; -static struct resource da9061_onkey_resources[] = { +static const struct resource da9061_onkey_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_ONKEY, "ONKEY"), }; @@ -211,32 +211,32 @@ static const struct mfd_cell da9061_devs[] = { }, }; -static struct resource da9062_core_resources[] = { +static const struct resource da9062_core_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_VDD_WARN, 1, "VDD_WARN", IORESOURCE_IRQ), }; -static struct resource da9062_regulators_resources[] = { +static const struct resource da9062_regulators_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_LDO_LIM, 1, "LDO_LIM", IORESOURCE_IRQ), }; -static struct resource da9062_thermal_resources[] = { +static const struct resource da9062_thermal_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_TEMP, 1, "THERMAL", IORESOURCE_IRQ), }; -static struct resource da9062_wdt_resources[] = { +static const struct resource da9062_wdt_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_WDG_WARN, 1, "WD_WARN", IORESOURCE_IRQ), }; -static struct resource da9062_rtc_resources[] = { +static const struct resource da9062_rtc_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_ALARM, 1, "ALARM", IORESOURCE_IRQ), DEFINE_RES_NAMED(DA9062_IRQ_TICK, 1, "TICK", IORESOURCE_IRQ), }; -static struct resource da9062_onkey_resources[] = { +static const struct resource da9062_onkey_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_ONKEY, 1, "ONKEY", IORESOURCE_IRQ), }; -static struct resource da9062_gpio_resources[] = { +static const struct resource da9062_gpio_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_GPI0, 1, "GPI0", IORESOURCE_IRQ), DEFINE_RES_NAMED(DA9062_IRQ_GPI1, 1, "GPI1", IORESOURCE_IRQ), DEFINE_RES_NAMED(DA9062_IRQ_GPI2, 1, "GPI2", IORESOURCE_IRQ), diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c index a353d52210a9..df407c3afce3 100644 --- a/drivers/mfd/da9063-core.c +++ b/drivers/mfd/da9063-core.c @@ -29,7 +29,7 @@ #include -static struct resource da9063_regulators_resources[] = { +static const struct resource da9063_regulators_resources[] = { { .name = "LDO_LIM", .start = DA9063_IRQ_LDO_LIM, @@ -38,7 +38,7 @@ static struct resource da9063_regulators_resources[] = { }, }; -static struct resource da9063_rtc_resources[] = { +static const struct resource da9063_rtc_resources[] = { { .name = "ALARM", .start = DA9063_IRQ_ALARM, @@ -53,7 +53,7 @@ static struct resource da9063_rtc_resources[] = { } }; -static struct resource da9063_onkey_resources[] = { +static const struct resource da9063_onkey_resources[] = { { .name = "ONKEY", .start = DA9063_IRQ_ONKEY, @@ -62,7 +62,7 @@ static struct resource da9063_onkey_resources[] = { }, }; -static struct resource da9063_hwmon_resources[] = { +static const struct resource da9063_hwmon_resources[] = { { .start = DA9063_IRQ_ADC_RDY, .end = DA9063_IRQ_ADC_RDY, diff --git a/drivers/mfd/da9150-core.c b/drivers/mfd/da9150-core.c index 7f0aa1e8db96..d8b0cde48589 100644 --- a/drivers/mfd/da9150-core.c +++ b/drivers/mfd/da9150-core.c @@ -350,18 +350,18 @@ static const struct regmap_irq_chip da9150_regmap_irq_chip = { .num_irqs = ARRAY_SIZE(da9150_irqs), }; -static struct resource da9150_gpadc_resources[] = { +static const struct resource da9150_gpadc_resources[] = { DEFINE_RES_IRQ_NAMED(DA9150_IRQ_GPADC, "GPADC"), }; -static struct resource da9150_charger_resources[] = { +static const struct resource da9150_charger_resources[] = { DEFINE_RES_IRQ_NAMED(DA9150_IRQ_CHG, "CHG_STATUS"), DEFINE_RES_IRQ_NAMED(DA9150_IRQ_TJUNC, "CHG_TJUNC"), DEFINE_RES_IRQ_NAMED(DA9150_IRQ_VFAULT, "CHG_VFAULT"), DEFINE_RES_IRQ_NAMED(DA9150_IRQ_VBUS, "CHG_VBUS"), }; -static struct resource da9150_fg_resources[] = { +static const struct resource da9150_fg_resources[] = { DEFINE_RES_IRQ_NAMED(DA9150_IRQ_FG, "FG"), }; From patchwork Tue Jul 16 08:22:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EFB3C3DA59 for ; Tue, 16 Jul 2024 08:23:08 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5818.1721118180107077795 for ; Tue, 16 Jul 2024 01:23:06 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467681" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:05 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 129CD4005B53; Tue, 16 Jul 2024 17:23:03 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 03/31] mfd: da9062: Drop of_match_ptr from of_device_id table Date: Tue, 16 Jul 2024 09:22:14 +0100 Message-ID: <20240716082255.56551-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:08 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16529 From: Krzysztof Kozlowski commit b62a16a51ae0bdf8fa8c360d5e993a4e24eed465 upstream. The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here). This fixes compile warning (!CONFIG_OF on x86_64): drivers/mfd/da9062-core.c:614:34: warning: ‘da9062_dt_ids’ defined but not used [-Wunused-const-variable=] Signed-off-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Signed-off-by: Biju Das --- drivers/mfd/da9062-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index 9583a98d3aae..8d913375152d 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -736,7 +736,7 @@ MODULE_DEVICE_TABLE(i2c, da9062_i2c_id); static struct i2c_driver da9062_i2c_driver = { .driver = { .name = "da9062", - .of_match_table = of_match_ptr(da9062_dt_ids), + .of_match_table = da9062_dt_ids, }, .probe = da9062_i2c_probe, .remove = da9062_i2c_remove, From patchwork Tue Jul 16 08:22:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734124 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40802C3DA61 for ; Tue, 16 Jul 2024 08:23:18 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5927.1721118184270232470 for ; Tue, 16 Jul 2024 01:23:08 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215425980" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:07 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 4E9DE4016D5E; Tue, 16 Jul 2024 17:23:06 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 04/31] mfd: da9062: Simplify getting of_device_id match data Date: Tue, 16 Jul 2024 09:22:15 +0100 Message-ID: <20240716082255.56551-5-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:18 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16530 From: Krzysztof Kozlowski commit 5783bbe9a434db870891a07cd7826944047368e5 upstream. Use of_device_get_match_data() to make the code slightly smaller. Signed-off-by: Krzysztof Kozlowski Acked-by: Adam Thomson Signed-off-by: Lee Jones Signed-off-by: Biju Das --- drivers/mfd/da9062-core.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index 8d913375152d..01f8e10dfa55 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -622,7 +623,6 @@ static int da9062_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct da9062 *chip; - const struct of_device_id *match; unsigned int irq_base; const struct mfd_cell *cell; const struct regmap_irq_chip *irq_chip; @@ -635,15 +635,10 @@ static int da9062_i2c_probe(struct i2c_client *i2c, if (!chip) return -ENOMEM; - if (i2c->dev.of_node) { - match = of_match_node(da9062_dt_ids, i2c->dev.of_node); - if (!match) - return -EINVAL; - - chip->chip_type = (uintptr_t)match->data; - } else { + if (i2c->dev.of_node) + chip->chip_type = (uintptr_t)of_device_get_match_data(&i2c->dev); + else chip->chip_type = id->driver_data; - } i2c_set_clientdata(i2c, chip); chip->dev = &i2c->dev; From patchwork Tue Jul 16 08:22:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734127 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 633C3C3DA59 for ; Tue, 16 Jul 2024 08:23:18 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5818.1721118180107077795 for ; Tue, 16 Jul 2024 01:23:10 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467688" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:10 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 8A7424005B53; Tue, 16 Jul 2024 17:23:08 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 05/31] mfd: da9062: Support SMBus and I2C mode Date: Tue, 16 Jul 2024 09:22:16 +0100 Message-ID: <20240716082255.56551-6-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:18 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16531 From: Andrej Picej commit 5c6f0f456351f5ca7d3b1a82060821eac4a7dc5c upstream. Enable the I2C bus mode if I2C_FUNC_I2C is set. Based on da6093 commit: "586478bfc9f7 mfd: da9063: Support SMBus and I2C mode" Signed-off-by: Andrej Picej Reviewed-by: Adam Thomson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211124065119.2514872-1-andrej.picej@norik.com Signed-off-by: Biju Das --- drivers/mfd/da9062-core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index 01f8e10dfa55..2774b2cbaea6 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -556,6 +556,7 @@ static const struct regmap_range da9062_aa_writeable_ranges[] = { regmap_reg_range(DA9062AA_VBUCK3_B, DA9062AA_VBUCK3_B), regmap_reg_range(DA9062AA_VLDO1_B, DA9062AA_VLDO4_B), regmap_reg_range(DA9062AA_BBAT_CONT, DA9062AA_BBAT_CONT), + regmap_reg_range(DA9062AA_CONFIG_J, DA9062AA_CONFIG_J), regmap_reg_range(DA9062AA_GP_ID_0, DA9062AA_GP_ID_19), }; @@ -674,6 +675,17 @@ static int da9062_i2c_probe(struct i2c_client *i2c, return ret; } + /* If SMBus is not available and only I2C is possible, enter I2C mode */ + if (i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) { + dev_info(chip->dev, "Entering I2C mode!\n"); + ret = regmap_clear_bits(chip->regmap, DA9062AA_CONFIG_J, + DA9062AA_TWOWIRE_TO_MASK); + if (ret < 0) { + dev_err(chip->dev, "Failed to set Two-Wire Bus Mode.\n"); + return ret; + } + } + ret = da9062_clear_fault_log(chip); if (ret < 0) dev_warn(chip->dev, "Cannot clear fault log\n"); From patchwork Tue Jul 16 08:22:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734123 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F6CAC3DA49 for ; Tue, 16 Jul 2024 08:23:18 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5927.1721118184270232470 for ; Tue, 16 Jul 2024 01:23:12 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215425987" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:12 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D687E4016D5E; Tue, 16 Jul 2024 17:23:10 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 06/31] mfd: da9061: Fix Failed to set Two-Wire Bus Mode. Date: Tue, 16 Jul 2024 09:22:17 +0100 Message-ID: <20240716082255.56551-7-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:18 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16532 From: Jens Hillenstedt commit 834382ea32865a4bdeae83ec2dcb9321dc9489f2 upstream. In da9062_i2c_probe() regmap_clear_bits() tries to access CONFIG_J register. As CONFIG_J is not present in da9061_aa_writeable_ranges[] probe of da9061 fails: da9062 2-0058: Entering I2C mode! da9062 2-0058: Failed to set Two-Wire Bus Mode. da9062: probe of 2-0058 failed with error -5 Add CONFIG_J register to da9061_aa_writeable_ranges[]. Fixes: 5c6f0f456351 ("mfd: da9062: Support SMBus and I2C mode") Signed-off-by: Jens Hillenstedt Reviewed-by: Adam Ward Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220915092004.168744-1-jens.hillenstedt@ise.de Signed-off-by: Biju Das --- drivers/mfd/da9062-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index 2774b2cbaea6..c2acdbcd5d6b 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -453,6 +453,7 @@ static const struct regmap_range da9061_aa_writeable_ranges[] = { regmap_reg_range(DA9062AA_VBUCK1_B, DA9062AA_VBUCK4_B), regmap_reg_range(DA9062AA_VBUCK3_B, DA9062AA_VBUCK3_B), regmap_reg_range(DA9062AA_VLDO1_B, DA9062AA_VLDO4_B), + regmap_reg_range(DA9062AA_CONFIG_J, DA9062AA_CONFIG_J), regmap_reg_range(DA9062AA_GP_ID_0, DA9062AA_GP_ID_19), }; From patchwork Tue Jul 16 08:22:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FC86C41513 for ; Tue, 16 Jul 2024 08:23:18 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5927.1721118184270232470 for ; Tue, 16 Jul 2024 01:23:15 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215425990" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:14 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 1C9CB4016D5E; Tue, 16 Jul 2024 17:23:12 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 07/31] mfd: da9062: Use MFD_CELL_OF macro Date: Tue, 16 Jul 2024 09:22:18 +0100 Message-ID: <20240716082255.56551-8-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:18 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16533 From: Christoph Niedermaier commit 7d61f6313e90cdbe592eba5e0ae6d1c367b03548 upstream. Use MFD_CELL_OF macro helper instead of plain struct properties, which makes the code a bit shorter and to have commonly defined MFD cell attributes. Signed-off-by: Christoph Niedermaier Acked-by: Adam Ward Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230309092254.56279-1-cniedermaier@dh-electronics.com [Biju: Replaced MFD_CELL_OF->OF_MFD_CELL] Signed-off-by: Biju Das --- drivers/mfd/da9062-core.c | 92 ++++++++++----------------------------- 1 file changed, 24 insertions(+), 68 deletions(-) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index c2acdbcd5d6b..ae5274315554 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -182,34 +182,16 @@ static const struct resource da9061_onkey_resources[] = { }; static const struct mfd_cell da9061_devs[] = { - { - .name = "da9061-core", - .num_resources = ARRAY_SIZE(da9061_core_resources), - .resources = da9061_core_resources, - }, - { - .name = "da9062-regulators", - .num_resources = ARRAY_SIZE(da9061_regulators_resources), - .resources = da9061_regulators_resources, - }, - { - .name = "da9061-watchdog", - .num_resources = ARRAY_SIZE(da9061_wdt_resources), - .resources = da9061_wdt_resources, - .of_compatible = "dlg,da9061-watchdog", - }, - { - .name = "da9061-thermal", - .num_resources = ARRAY_SIZE(da9061_thermal_resources), - .resources = da9061_thermal_resources, - .of_compatible = "dlg,da9061-thermal", - }, - { - .name = "da9061-onkey", - .num_resources = ARRAY_SIZE(da9061_onkey_resources), - .resources = da9061_onkey_resources, - .of_compatible = "dlg,da9061-onkey", - }, + OF_MFD_CELL("da9061-core", da9061_core_resources, NULL, 0, 0, + NULL), + OF_MFD_CELL("da9062-regulators", da9061_regulators_resources, NULL, 0, 0, + NULL), + OF_MFD_CELL("da9061-watchdog", da9061_wdt_resources, NULL, 0, 0, + "dlg,da9061-watchdog"), + OF_MFD_CELL("da9061-thermal", da9061_thermal_resources, NULL, 0, 0, + "dlg,da9061-thermal"), + OF_MFD_CELL("da9061-onkey", da9061_onkey_resources, NULL, 0, 0, + "dlg,da9061-onkey"), }; static const struct resource da9062_core_resources[] = { @@ -246,46 +228,20 @@ static const struct resource da9062_gpio_resources[] = { }; static const struct mfd_cell da9062_devs[] = { - { - .name = "da9062-core", - .num_resources = ARRAY_SIZE(da9062_core_resources), - .resources = da9062_core_resources, - }, - { - .name = "da9062-regulators", - .num_resources = ARRAY_SIZE(da9062_regulators_resources), - .resources = da9062_regulators_resources, - }, - { - .name = "da9062-watchdog", - .num_resources = ARRAY_SIZE(da9062_wdt_resources), - .resources = da9062_wdt_resources, - .of_compatible = "dlg,da9062-watchdog", - }, - { - .name = "da9062-thermal", - .num_resources = ARRAY_SIZE(da9062_thermal_resources), - .resources = da9062_thermal_resources, - .of_compatible = "dlg,da9062-thermal", - }, - { - .name = "da9062-rtc", - .num_resources = ARRAY_SIZE(da9062_rtc_resources), - .resources = da9062_rtc_resources, - .of_compatible = "dlg,da9062-rtc", - }, - { - .name = "da9062-onkey", - .num_resources = ARRAY_SIZE(da9062_onkey_resources), - .resources = da9062_onkey_resources, - .of_compatible = "dlg,da9062-onkey", - }, - { - .name = "da9062-gpio", - .num_resources = ARRAY_SIZE(da9062_gpio_resources), - .resources = da9062_gpio_resources, - .of_compatible = "dlg,da9062-gpio", - }, + OF_MFD_CELL("da9062-core", da9062_core_resources, NULL, 0, 0, + NULL), + OF_MFD_CELL("da9062-regulators", da9062_regulators_resources, NULL, 0, 0, + NULL), + OF_MFD_CELL("da9062-watchdog", da9062_wdt_resources, NULL, 0, 0, + "dlg,da9062-watchdog"), + OF_MFD_CELL("da9062-thermal", da9062_thermal_resources, NULL, 0, 0, + "dlg,da9062-thermal"), + OF_MFD_CELL("da9062-rtc", da9062_rtc_resources, NULL, 0, 0, + "dlg,da9062-rtc"), + OF_MFD_CELL("da9062-onkey", da9062_onkey_resources, NULL, 0, 0, + "dlg,da9062-onkey"), + OF_MFD_CELL("da9062-gpio", da9062_gpio_resources, NULL, 0, 0, + "dlg,da9062-gpio"), }; static int da9062_clear_fault_log(struct da9062 *chip) From patchwork Tue Jul 16 08:22:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734126 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F840C3DA5D for ; Tue, 16 Jul 2024 08:23:18 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5927.1721118184270232470 for ; Tue, 16 Jul 2024 01:23:17 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215425998" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:17 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 5BD6040178CB; Tue, 16 Jul 2024 17:23:15 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 08/31] mfd: da9062: Remove IRQ requirement Date: Tue, 16 Jul 2024 09:22:19 +0100 Message-ID: <20240716082255.56551-9-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:18 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16534 From: Christoph Niedermaier commit c923d5001ba054df10ed3441d24f8f2c01db7e00 upstream. This patch removes the requirement for an IRQ, because for the core functionality IRQ isn't needed. So this makes the DA9061/62 chip usable for designs which haven't connected the IRQ pin. Signed-off-by: Christoph Niedermaier Acked-by: Adam Ward Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230309092254.56279-2-cniedermaier@dh-electronics.com Signed-off-by: Biju Das --- drivers/mfd/da9062-core.c | 84 +++++++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index ae5274315554..f821ef4909ec 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -181,7 +181,7 @@ static const struct resource da9061_onkey_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_ONKEY, "ONKEY"), }; -static const struct mfd_cell da9061_devs[] = { +static const struct mfd_cell da9061_devs_irq[] = { OF_MFD_CELL("da9061-core", da9061_core_resources, NULL, 0, 0, NULL), OF_MFD_CELL("da9062-regulators", da9061_regulators_resources, NULL, 0, 0, @@ -194,6 +194,14 @@ static const struct mfd_cell da9061_devs[] = { "dlg,da9061-onkey"), }; +static const struct mfd_cell da9061_devs_noirq[] = { + OF_MFD_CELL("da9061-core", NULL, NULL, 0, 0, NULL), + OF_MFD_CELL("da9062-regulators", NULL, NULL, 0, 0, NULL), + OF_MFD_CELL("da9061-watchdog", NULL, NULL, 0, 0, "dlg,da9061-watchdog"), + OF_MFD_CELL("da9061-thermal", NULL, NULL, 0, 0, "dlg,da9061-thermal"), + OF_MFD_CELL("da9061-onkey", NULL, NULL, 0, 0, "dlg,da9061-onkey"), +}; + static const struct resource da9062_core_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_VDD_WARN, 1, "VDD_WARN", IORESOURCE_IRQ), }; @@ -227,7 +235,7 @@ static const struct resource da9062_gpio_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_GPI4, 1, "GPI4", IORESOURCE_IRQ), }; -static const struct mfd_cell da9062_devs[] = { +static const struct mfd_cell da9062_devs_irq[] = { OF_MFD_CELL("da9062-core", da9062_core_resources, NULL, 0, 0, NULL), OF_MFD_CELL("da9062-regulators", da9062_regulators_resources, NULL, 0, 0, @@ -244,6 +252,16 @@ static const struct mfd_cell da9062_devs[] = { "dlg,da9062-gpio"), }; +static const struct mfd_cell da9062_devs_noirq[] = { + OF_MFD_CELL("da9062-core", NULL, NULL, 0, 0, NULL), + OF_MFD_CELL("da9062-regulators", NULL, NULL, 0, 0, NULL), + OF_MFD_CELL("da9062-watchdog", NULL, NULL, 0, 0, "dlg,da9062-watchdog"), + OF_MFD_CELL("da9062-thermal", NULL, NULL, 0, 0, "dlg,da9062-thermal"), + OF_MFD_CELL("da9062-rtc", NULL, NULL, 0, 0, "dlg,da9062-rtc"), + OF_MFD_CELL("da9062-onkey", NULL, NULL, 0, 0, "dlg,da9062-onkey"), + OF_MFD_CELL("da9062-gpio", NULL, NULL, 0, 0, "dlg,da9062-gpio"), +}; + static int da9062_clear_fault_log(struct da9062 *chip) { int ret; @@ -581,7 +599,7 @@ static int da9062_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct da9062 *chip; - unsigned int irq_base; + unsigned int irq_base = 0; const struct mfd_cell *cell; const struct regmap_irq_chip *irq_chip; const struct regmap_config *config; @@ -601,22 +619,16 @@ static int da9062_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, chip); chip->dev = &i2c->dev; - if (!i2c->irq) { - dev_err(chip->dev, "No IRQ configured\n"); - return -EINVAL; - } - + /* Start with a base configuration without IRQ */ switch (chip->chip_type) { case COMPAT_TYPE_DA9061: - cell = da9061_devs; - cell_num = ARRAY_SIZE(da9061_devs); - irq_chip = &da9061_irq_chip; + cell = da9061_devs_noirq; + cell_num = ARRAY_SIZE(da9061_devs_noirq); config = &da9061_regmap_config; break; case COMPAT_TYPE_DA9062: - cell = da9062_devs; - cell_num = ARRAY_SIZE(da9062_devs); - irq_chip = &da9062_irq_chip; + cell = da9062_devs_noirq; + cell_num = ARRAY_SIZE(da9062_devs_noirq); config = &da9062_regmap_config; break; default: @@ -651,29 +663,43 @@ static int da9062_i2c_probe(struct i2c_client *i2c, if (ret) return ret; - ret = da9062_configure_irq_type(chip, i2c->irq, &trigger_type); - if (ret < 0) { - dev_err(chip->dev, "Failed to configure IRQ type\n"); - return ret; - } + /* If IRQ is available, reconfigure it accordingly */ + if (i2c->irq) { + if (chip->chip_type == COMPAT_TYPE_DA9061) { + cell = da9061_devs_irq; + cell_num = ARRAY_SIZE(da9061_devs_irq); + irq_chip = &da9061_irq_chip; + } else { + cell = da9062_devs_irq; + cell_num = ARRAY_SIZE(da9062_devs_irq); + irq_chip = &da9062_irq_chip; + } - ret = regmap_add_irq_chip(chip->regmap, i2c->irq, - trigger_type | IRQF_SHARED | IRQF_ONESHOT, - -1, irq_chip, &chip->regmap_irq); - if (ret) { - dev_err(chip->dev, "Failed to request IRQ %d: %d\n", - i2c->irq, ret); - return ret; - } + ret = da9062_configure_irq_type(chip, i2c->irq, &trigger_type); + if (ret < 0) { + dev_err(chip->dev, "Failed to configure IRQ type\n"); + return ret; + } - irq_base = regmap_irq_chip_get_base(chip->regmap_irq); + ret = regmap_add_irq_chip(chip->regmap, i2c->irq, + trigger_type | IRQF_SHARED | IRQF_ONESHOT, + -1, irq_chip, &chip->regmap_irq); + if (ret) { + dev_err(chip->dev, "Failed to request IRQ %d: %d\n", + i2c->irq, ret); + return ret; + } + + irq_base = regmap_irq_chip_get_base(chip->regmap_irq); + } ret = mfd_add_devices(chip->dev, PLATFORM_DEVID_NONE, cell, cell_num, NULL, irq_base, NULL); if (ret) { dev_err(chip->dev, "Cannot register child devices\n"); - regmap_del_irq_chip(i2c->irq, chip->regmap_irq); + if (i2c->irq) + regmap_del_irq_chip(i2c->irq, chip->regmap_irq); return ret; } From patchwork Tue Jul 16 08:22:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734128 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62CCAC41513 for ; Tue, 16 Jul 2024 08:23:28 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5823.1721118199820537896 for ; Tue, 16 Jul 2024 01:23:20 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467700" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:19 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 947FC4005B53; Tue, 16 Jul 2024 17:23:17 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 09/31] mfd: da9062: Simplify obtaining I2C match data Date: Tue, 16 Jul 2024 09:22:20 +0100 Message-ID: <20240716082255.56551-10-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:28 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16535 commit 9b413e3c07d251191410976d669260079b48e7b1 upstream. Simplify probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Some minor cleanups: * Remove the trailing comma in the terminator entry for the ID table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. * Move OF table near to the user. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231204124507.124758-1-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones Signed-off-by: Biju Das --- drivers/mfd/da9062-core.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index f821ef4909ec..3ee320160d4d 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -588,13 +588,6 @@ static struct regmap_config da9062_regmap_config = { .volatile_table = &da9062_aa_volatile_table, }; -static const struct of_device_id da9062_dt_ids[] = { - { .compatible = "dlg,da9061", .data = (void *)COMPAT_TYPE_DA9061, }, - { .compatible = "dlg,da9062", .data = (void *)COMPAT_TYPE_DA9062, }, - { } -}; -MODULE_DEVICE_TABLE(of, da9062_dt_ids); - static int da9062_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -611,10 +604,7 @@ static int da9062_i2c_probe(struct i2c_client *i2c, if (!chip) return -ENOMEM; - if (i2c->dev.of_node) - chip->chip_type = (uintptr_t)of_device_get_match_data(&i2c->dev); - else - chip->chip_type = id->driver_data; + chip->chip_type = (uintptr_t)i2c_get_match_data(i2c); i2c_set_clientdata(i2c, chip); chip->dev = &i2c->dev; @@ -716,10 +706,17 @@ static int da9062_i2c_remove(struct i2c_client *i2c) return 0; } +static const struct of_device_id da9062_dt_ids[] = { + { .compatible = "dlg,da9061", .data = (void *)COMPAT_TYPE_DA9061 }, + { .compatible = "dlg,da9062", .data = (void *)COMPAT_TYPE_DA9062 }, + { } +}; +MODULE_DEVICE_TABLE(of, da9062_dt_ids); + static const struct i2c_device_id da9062_i2c_id[] = { { "da9061", COMPAT_TYPE_DA9061 }, { "da9062", COMPAT_TYPE_DA9062 }, - { }, + { } }; MODULE_DEVICE_TABLE(i2c, da9062_i2c_id); From patchwork Tue Jul 16 08:22:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F0D6C3DA5D for ; Tue, 16 Jul 2024 08:23:28 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5927.1721118184270232470 for ; Tue, 16 Jul 2024 01:23:22 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426007" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:21 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D32224005B53; Tue, 16 Jul 2024 17:23:19 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 10/31] rtc: da9063: Simplify bool comparison Date: Tue, 16 Jul 2024 09:22:21 +0100 Message-ID: <20240716082255.56551-11-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:28 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16536 From: Kaixu Xia commit a48c6224ae07bed02893c58073ca2942acb5c3d5 upstream. Fix the following coccicheck warning: ./drivers/rtc/rtc-da9063.c:246:5-18: WARNING: Comparison to bool Reported-by: Tosk Robot Signed-off-by: Kaixu Xia Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1604649637-1014-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Biju Das --- drivers/rtc/rtc-da9063.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c index 046b1d4c3dae..6f0a3a711135 100644 --- a/drivers/rtc/rtc-da9063.c +++ b/drivers/rtc/rtc-da9063.c @@ -243,7 +243,7 @@ static int da9063_rtc_read_time(struct device *dev, struct rtc_time *tm) al_secs = rtc_tm_to_time64(&rtc->alarm_time); /* handle the rtc synchronisation delay */ - if (rtc->rtc_sync == true && al_secs - tm_secs == 1) + if (rtc->rtc_sync && al_secs - tm_secs == 1) memcpy(tm, &rtc->alarm_time, sizeof(struct rtc_time)); else rtc->rtc_sync = false; From patchwork Tue Jul 16 08:22:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D8ABC3DA49 for ; Tue, 16 Jul 2024 08:23:28 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5927.1721118184270232470 for ; Tue, 16 Jul 2024 01:23:24 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426015" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:23 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 1EBB24016D5E; Tue, 16 Jul 2024 17:23:21 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 11/31] rtc: da9063: add as wakeup source Date: Tue, 16 Jul 2024 09:22:22 +0100 Message-ID: <20240716082255.56551-12-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:28 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16537 From: Nikita Shubin commit 029d3a6f2f3c73ac29a7460d8007798e940488fd upstream. As da9063 RTC is not a real I2C client, but relies on da9063 MFD driver, we need to explicitly mark da9063 RTC as a wakeup source to be able to access class/rtc/rtcN/wakealarm sysfs entry to set alarms, so we can wakeup from SHUTDOWN/RTC/DELIVERY mode. As da9063 driver refuses to load without irq, we simply add it as a wakeup source before registering rtc device. Signed-off-by: Nikita Shubin Reviewed-by: Adam Thomson Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211129072650.22686-1-nikita.shubin@maquefel.me Signed-off-by: Biju Das --- drivers/rtc/rtc-da9063.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c index 6f0a3a711135..490ba89efa41 100644 --- a/drivers/rtc/rtc-da9063.c +++ b/drivers/rtc/rtc-da9063.c @@ -494,6 +494,8 @@ static int da9063_rtc_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Failed to request ALARM IRQ %d: %d\n", irq_alarm, ret); + device_init_wakeup(&pdev->dev, true); + return rtc_register_device(rtc->rtc_dev); } From patchwork Tue Jul 16 08:22:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AB68C3DA59 for ; Tue, 16 Jul 2024 08:23:28 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5828.1721118206600010734 for ; Tue, 16 Jul 2024 01:23:26 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467715" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:26 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 5A20B4005B53; Tue, 16 Jul 2024 17:23:24 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 12/31] rtc: da9063: Mark the alarm IRQ as a wake IRQ Date: Tue, 16 Jul 2024 09:22:23 +0100 Message-ID: <20240716082255.56551-13-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:28 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16538 From: Samuel Holland commit ed17a2bcbb75505bb979e3e8ecb6c5fb2518bf3b upstream. This keeps the IRQ enabled during system suspend, if the RTC's wakeup source is enabled. Since the IRQ is not required to wake from shutdown, continue to add the wakeup source even if registering the wakeirq fails. See commit 029d3a6f2f3c ("rtc: da9063: add as wakeup source"). Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20230717190937.1301509-1-samuel.holland@sifive.com Signed-off-by: Alexandre Belloni Signed-off-by: Biju Das --- drivers/rtc/rtc-da9063.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c index 490ba89efa41..e1deb0793188 100644 --- a/drivers/rtc/rtc-da9063.c +++ b/drivers/rtc/rtc-da9063.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -494,6 +495,12 @@ static int da9063_rtc_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Failed to request ALARM IRQ %d: %d\n", irq_alarm, ret); + ret = dev_pm_set_wake_irq(&pdev->dev, irq_alarm); + if (ret) + dev_warn(&pdev->dev, + "Failed to set IRQ %d as a wake IRQ: %d\n", + irq_alarm, ret); + device_init_wakeup(&pdev->dev, true); return rtc_register_device(rtc->rtc_dev); From patchwork Tue Jul 16 08:22:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7144DC3DA59 for ; Tue, 16 Jul 2024 08:23:38 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5828.1721118206600010734 for ; Tue, 16 Jul 2024 01:23:28 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467721" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:28 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 944464016D5E; Tue, 16 Jul 2024 17:23:26 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 13/31] rtc: da9063: Make IRQ as optional Date: Tue, 16 Jul 2024 09:22:24 +0100 Message-ID: <20240716082255.56551-14-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:38 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16539 commit 8681de6457aa071a5982e9b20682e56a7d87e3b6 upstream. On some platforms (eg: RZ/{G2UL,Five} SMARC EVK), there is no IRQ populated by default. Add irq optional support. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20240105145344.204453-2-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni [Biju: Replaced clear_bit(RTC_FEATURE_ALARM, ...) with rtc->rtc_dev->uie_unsupported = 1] Signed-off-by: Biju Das --- drivers/rtc/rtc-da9063.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c index e1deb0793188..baedcd15d8f2 100644 --- a/drivers/rtc/rtc-da9063.c +++ b/drivers/rtc/rtc-da9063.c @@ -483,25 +483,29 @@ static int da9063_rtc_probe(struct platform_device *pdev) if (config->rtc_data_start != RTC_SEC) rtc->rtc_dev->uie_unsupported = 1; - irq_alarm = platform_get_irq_byname(pdev, "ALARM"); - if (irq_alarm < 0) + irq_alarm = platform_get_irq_byname_optional(pdev, "ALARM"); + if (irq_alarm >= 0) { + ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL, + da9063_alarm_event, + IRQF_TRIGGER_LOW | IRQF_ONESHOT, + "ALARM", rtc); + if (ret) + dev_err(&pdev->dev, + "Failed to request ALARM IRQ %d: %d\n", + irq_alarm, ret); + + ret = dev_pm_set_wake_irq(&pdev->dev, irq_alarm); + if (ret) + dev_warn(&pdev->dev, + "Failed to set IRQ %d as a wake IRQ: %d\n", + irq_alarm, ret); + + device_init_wakeup(&pdev->dev, true); + } else if (irq_alarm != -ENXIO) { return irq_alarm; - - ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL, - da9063_alarm_event, - IRQF_TRIGGER_LOW | IRQF_ONESHOT, - "ALARM", rtc); - if (ret) - dev_err(&pdev->dev, "Failed to request ALARM IRQ %d: %d\n", - irq_alarm, ret); - - ret = dev_pm_set_wake_irq(&pdev->dev, irq_alarm); - if (ret) - dev_warn(&pdev->dev, - "Failed to set IRQ %d as a wake IRQ: %d\n", - irq_alarm, ret); - - device_init_wakeup(&pdev->dev, true); + } else { + rtc->rtc_dev->uie_unsupported = 1; + } return rtc_register_device(rtc->rtc_dev); } From patchwork Tue Jul 16 08:22:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BBD4C3DA5D for ; Tue, 16 Jul 2024 08:23:38 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:23:31 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426026" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:30 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id DF9CF4016D5E; Tue, 16 Jul 2024 17:23:28 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 14/31] rtc: da9063: Use device_get_match_data() Date: Tue, 16 Jul 2024 09:22:25 +0100 Message-ID: <20240716082255.56551-15-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:38 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16540 commit 4b60c32e979ac84a715c329161ddf42b0790be4e upstream. Replace of_match_node()->device_get_match_data() for the data associated with device match. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20240105145344.204453-3-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni Signed-off-by: Biju Das --- drivers/rtc/rtc-da9063.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c index baedcd15d8f2..b71e0920bb72 100644 --- a/drivers/rtc/rtc-da9063.c +++ b/drivers/rtc/rtc-da9063.c @@ -377,7 +377,6 @@ static int da9063_rtc_probe(struct platform_device *pdev) { struct da9063_compatible_rtc *rtc; const struct da9063_compatible_rtc_regmap *config; - const struct of_device_id *match; int irq_alarm; u8 data[RTC_DATA_LEN]; int ret; @@ -385,14 +384,11 @@ static int da9063_rtc_probe(struct platform_device *pdev) if (!pdev->dev.of_node) return -ENXIO; - match = of_match_node(da9063_compatible_reg_id_table, - pdev->dev.of_node); - rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); if (!rtc) return -ENOMEM; - rtc->config = match->data; + rtc->config = device_get_match_data(&pdev->dev); if (of_device_is_compatible(pdev->dev.of_node, "dlg,da9063-rtc")) { struct da9063 *chip = dev_get_drvdata(pdev->dev.parent); From patchwork Tue Jul 16 08:22:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 725F9C3DA49 for ; Tue, 16 Jul 2024 08:23:38 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5828.1721118206600010734 for ; Tue, 16 Jul 2024 01:23:33 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467725" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:32 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 4C81F4016D5E; Tue, 16 Jul 2024 17:23:31 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 15/31] rtc: da9063: Use dev_err_probe() Date: Tue, 16 Jul 2024 09:22:26 +0100 Message-ID: <20240716082255.56551-16-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:38 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16541 commit f5334aa88345874d54a406e86a886a54173e1ba8 upstream. Replace dev_err()->dev_err_probe() to simpilfy probe(). Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20240105145344.204453-4-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni Signed-off-by: Biju Das --- drivers/rtc/rtc-da9063.c | 42 ++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c index b71e0920bb72..f1489127f937 100644 --- a/drivers/rtc/rtc-da9063.c +++ b/drivers/rtc/rtc-da9063.c @@ -407,57 +407,49 @@ static int da9063_rtc_probe(struct platform_device *pdev) config->rtc_enable_reg, config->rtc_enable_mask, config->rtc_enable_mask); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to enable RTC\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, "Failed to enable RTC\n"); ret = regmap_update_bits(rtc->regmap, config->rtc_enable_32k_crystal_reg, config->rtc_crystal_mask, config->rtc_crystal_mask); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to run 32kHz oscillator\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, + "Failed to run 32kHz oscillator\n"); ret = regmap_update_bits(rtc->regmap, config->rtc_alarm_secs_reg, config->rtc_alarm_status_mask, 0); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to access RTC alarm register\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, + "Failed to access RTC alarm register\n"); ret = regmap_update_bits(rtc->regmap, config->rtc_alarm_secs_reg, DA9063_ALARM_STATUS_ALARM, DA9063_ALARM_STATUS_ALARM); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to access RTC alarm register\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, + "Failed to access RTC alarm register\n"); ret = regmap_update_bits(rtc->regmap, config->rtc_alarm_year_reg, config->rtc_tick_on_mask, 0); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to disable TICKs\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, + "Failed to disable TICKs\n"); data[RTC_SEC] = 0; ret = regmap_bulk_read(rtc->regmap, config->rtc_alarm_secs_reg, &data[config->rtc_data_start], config->rtc_alarm_len); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to read initial alarm data: %d\n", - ret); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, + "Failed to read initial alarm data\n"); platform_set_drvdata(pdev, rtc); From patchwork Tue Jul 16 08:22:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734135 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DC2AC41513 for ; Tue, 16 Jul 2024 08:23:38 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:23:35 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426033" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:35 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 8F4DC4005B53; Tue, 16 Jul 2024 17:23:33 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 16/31] pinctrl: Propagate firmware node from a parent device Date: Tue, 16 Jul 2024 09:22:27 +0100 Message-ID: <20240716082255.56551-17-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:38 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16542 From: Andy Shevchenko commit ce852837335abc874e4d943ebbbe7432465a413b upstream. When creating MFD platform devices the firmware node is left unset. This, in particular, prevents GPIO library to use it for different purposes. Propagate firmware node from the parent device and let GPIO library do the right thing. While at it, slightly modify the headers to reflect the usage of APIs. Signed-off-by: Andy Shevchenko Acked-by: Charles Keepax Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/20211216151227.58687-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij [biju: Dropped changes related to cirrus/pinctrl-madera-core.c, pinctrl-as3722.c,pinctrl-max77620.c and pinctrl-rk805.c] Signed-off-by: Biju Das --- drivers/pinctrl/pinctrl-da9062.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-da9062.c b/drivers/pinctrl/pinctrl-da9062.c index 1c08579f0198..0e0ac3f3ffef 100644 --- a/drivers/pinctrl/pinctrl-da9062.c +++ b/drivers/pinctrl/pinctrl-da9062.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -256,6 +257,8 @@ static int da9062_pctl_probe(struct platform_device *pdev) struct da9062_pctl *pctl; int i; + device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent)); + pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); if (!pctl) return -ENOMEM; @@ -277,9 +280,6 @@ static int da9062_pctl_probe(struct platform_device *pdev) pctl->gc = reference_gc; pctl->gc.label = dev_name(&pdev->dev); pctl->gc.parent = &pdev->dev; -#ifdef CONFIG_OF_GPIO - pctl->gc.of_node = parent->of_node; -#endif platform_set_drvdata(pdev, pctl); From patchwork Tue Jul 16 08:22:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734136 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F29CC3DA49 for ; Tue, 16 Jul 2024 08:23:48 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:23:37 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426042" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:37 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id CEB394016D5E; Tue, 16 Jul 2024 17:23:35 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 17/31] pinctrl: da9062: Add OF table Date: Tue, 16 Jul 2024 09:22:28 +0100 Message-ID: <20240716082255.56551-18-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:48 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16543 commit 26fea220ad5b97b448741eb6103bb49830b67eb2 upstream. Add OF table as per the binding so that driver get instantiated and bind automatically when the driver is built as a module. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20240226191607.397386-1-biju.das.jz@bp.renesas.com Signed-off-by: Linus Walleij Signed-off-by: Biju Das --- drivers/pinctrl/pinctrl-da9062.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/pinctrl/pinctrl-da9062.c b/drivers/pinctrl/pinctrl-da9062.c index 0e0ac3f3ffef..e5c0ad22b759 100644 --- a/drivers/pinctrl/pinctrl-da9062.c +++ b/drivers/pinctrl/pinctrl-da9062.c @@ -286,10 +286,17 @@ static int da9062_pctl_probe(struct platform_device *pdev) return devm_gpiochip_add_data(&pdev->dev, &pctl->gc, pctl); } +static const struct of_device_id da9062_compatible_reg_id_table[] = { + { .compatible = "dlg,da9062-gpio" }, + { } +}; +MODULE_DEVICE_TABLE(of, da9062_compatible_reg_id_table); + static struct platform_driver da9062_pctl_driver = { .probe = da9062_pctl_probe, .driver = { .name = "da9062-gpio", + .of_match_table = da9062_compatible_reg_id_table, }, }; module_platform_driver(da9062_pctl_driver); From patchwork Tue Jul 16 08:22:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734138 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4CC4C3DA62 for ; Tue, 16 Jul 2024 08:23:48 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5832.1721118220324006117 for ; Tue, 16 Jul 2024 01:23:40 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467740" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:39 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 14FCF4016D5E; Tue, 16 Jul 2024 17:23:37 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 18/31] Input: da9063 - add wakeup support Date: Tue, 16 Jul 2024 09:22:29 +0100 Message-ID: <20240716082255.56551-19-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:48 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16544 From: Samuel Holland commit d7781232b5b2d049e654d5ead9921dc49090d214 upstream. Mark the IRQ as a wake IRQ so it will be enabled during system suspend. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20230717192004.1304287-1-samuel.holland@sifive.com Signed-off-by: Dmitry Torokhov Signed-off-by: Biju Das --- drivers/input/misc/da9063_onkey.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c index 79851923ee57..b9fbc62d29ab 100644 --- a/drivers/input/misc/da9063_onkey.c +++ b/drivers/input/misc/da9063_onkey.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -258,6 +259,14 @@ static int da9063_onkey_probe(struct platform_device *pdev) return error; } + error = dev_pm_set_wake_irq(&pdev->dev, irq); + if (error) + dev_warn(&pdev->dev, + "Failed to set IRQ %d as a wake IRQ: %d\n", + irq, error); + else + device_init_wakeup(&pdev->dev, true); + error = input_register_device(onkey->input); if (error) { dev_err(&pdev->dev, From patchwork Tue Jul 16 08:22:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734137 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83ABCC41513 for ; Tue, 16 Jul 2024 08:23:48 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:23:42 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426049" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:42 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 565344016D5E; Tue, 16 Jul 2024 17:23:40 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 19/31] Input: da9063 - simplify obtaining OF match data Date: Tue, 16 Jul 2024 09:22:30 +0100 Message-ID: <20240716082255.56551-20-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:48 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16545 commit 9594f273fafe76663e502337eaf393dc4f7bf8fa upstream. Simplify probe() by replacing of_match_node() for retrieving match data by device_get_match_data(). Some minor cleanups: * Remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. * Move OF table near to the user. * Arrange variables in reverse xmas tree order in probe(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20231213214803.9931-2-biju.das.jz@bp.renesas.com Signed-off-by: Dmitry Torokhov Signed-off-by: Biju Das --- drivers/input/misc/da9063_onkey.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c index b9fbc62d29ab..2823b19fcbf3 100644 --- a/drivers/input/misc/da9063_onkey.c +++ b/drivers/input/misc/da9063_onkey.c @@ -73,13 +73,6 @@ static const struct da906x_chip_config da9062_regs = { .name = "da9062-onkey", }; -static const struct of_device_id da9063_compatible_reg_id_table[] = { - { .compatible = "dlg,da9063-onkey", .data = &da9063_regs }, - { .compatible = "dlg,da9062-onkey", .data = &da9062_regs }, - { }, -}; -MODULE_DEVICE_TABLE(of, da9063_compatible_reg_id_table); - static void da9063_poll_on(struct work_struct *work) { struct da9063_onkey *onkey = container_of(work, @@ -193,14 +186,8 @@ static void da9063_cancel_poll(void *data) static int da9063_onkey_probe(struct platform_device *pdev) { struct da9063_onkey *onkey; - const struct of_device_id *match; - int irq; int error; - - match = of_match_node(da9063_compatible_reg_id_table, - pdev->dev.of_node); - if (!match) - return -ENXIO; + int irq; onkey = devm_kzalloc(&pdev->dev, sizeof(struct da9063_onkey), GFP_KERNEL); @@ -209,7 +196,10 @@ static int da9063_onkey_probe(struct platform_device *pdev) return -ENOMEM; } - onkey->config = match->data; + onkey->config = device_get_match_data(&pdev->dev); + if (!onkey->config) + return -ENXIO; + onkey->dev = &pdev->dev; onkey->regmap = dev_get_regmap(pdev->dev.parent, NULL); @@ -277,6 +267,13 @@ static int da9063_onkey_probe(struct platform_device *pdev) return 0; } +static const struct of_device_id da9063_compatible_reg_id_table[] = { + { .compatible = "dlg,da9063-onkey", .data = &da9063_regs }, + { .compatible = "dlg,da9062-onkey", .data = &da9062_regs }, + { } +}; +MODULE_DEVICE_TABLE(of, da9063_compatible_reg_id_table); + static struct platform_driver da9063_onkey_driver = { .probe = da9063_onkey_probe, .driver = { From patchwork Tue Jul 16 08:22:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734140 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F9FFC3DA59 for ; Tue, 16 Jul 2024 08:23:48 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5832.1721118220324006117 for ; Tue, 16 Jul 2024 01:23:44 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467749" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:44 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 90B884016D5E; Tue, 16 Jul 2024 17:23:42 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 20/31] Input: da9063 - drop redundant prints in probe() Date: Tue, 16 Jul 2024 09:22:31 +0100 Message-ID: <20240716082255.56551-21-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:48 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16546 commit bd2334eda183a2888b5541605b39617c1e6b4b71 upstream. The memory allocation core code already prints error message in case of OOM. So, drop additional print messages for OOM cases. While at it, input_register_device() is already printing error messages on failure. Drop the redundant print. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20231213214803.9931-3-biju.das.jz@bp.renesas.com Signed-off-by: Dmitry Torokhov Signed-off-by: Biju Das --- drivers/input/misc/da9063_onkey.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c index 2823b19fcbf3..5024703484e7 100644 --- a/drivers/input/misc/da9063_onkey.c +++ b/drivers/input/misc/da9063_onkey.c @@ -191,10 +191,8 @@ static int da9063_onkey_probe(struct platform_device *pdev) onkey = devm_kzalloc(&pdev->dev, sizeof(struct da9063_onkey), GFP_KERNEL); - if (!onkey) { - dev_err(&pdev->dev, "Failed to allocate memory.\n"); + if (!onkey) return -ENOMEM; - } onkey->config = device_get_match_data(&pdev->dev); if (!onkey->config) @@ -212,10 +210,8 @@ static int da9063_onkey_probe(struct platform_device *pdev) "dlg,disable-key-power"); onkey->input = devm_input_allocate_device(&pdev->dev); - if (!onkey->input) { - dev_err(&pdev->dev, "Failed to allocated input device.\n"); + if (!onkey->input) return -ENOMEM; - } onkey->input->name = onkey->config->name; snprintf(onkey->phys, sizeof(onkey->phys), "%s/input0", @@ -258,11 +254,8 @@ static int da9063_onkey_probe(struct platform_device *pdev) device_init_wakeup(&pdev->dev, true); error = input_register_device(onkey->input); - if (error) { - dev_err(&pdev->dev, - "Failed to register input device: %d\n", error); + if (error) return error; - } return 0; } From patchwork Tue Jul 16 08:22:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734139 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FD9DC3DA61 for ; Tue, 16 Jul 2024 08:23:48 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:23:46 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426056" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:46 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id CB8F34016D5E; Tue, 16 Jul 2024 17:23:44 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 21/31] Input: da9063 - use dev_err_probe() Date: Tue, 16 Jul 2024 09:22:32 +0100 Message-ID: <20240716082255.56551-22-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:48 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16547 commit c67f8a13be4e9ffc862c7f60ec97a799a1547486 upstream. Replace dev_err()->dev_err_probe() to simplify probe(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20231213214803.9931-4-biju.das.jz@bp.renesas.com Signed-off-by: Dmitry Torokhov Signed-off-by: Biju Das --- drivers/input/misc/da9063_onkey.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c index 5024703484e7..46539c53fb44 100644 --- a/drivers/input/misc/da9063_onkey.c +++ b/drivers/input/misc/da9063_onkey.c @@ -201,10 +201,9 @@ static int da9063_onkey_probe(struct platform_device *pdev) onkey->dev = &pdev->dev; onkey->regmap = dev_get_regmap(pdev->dev.parent, NULL); - if (!onkey->regmap) { - dev_err(&pdev->dev, "Parent regmap unavailable.\n"); - return -ENXIO; - } + if (!onkey->regmap) + return dev_err_probe(&pdev->dev, -ENXIO, + "Parent regmap unavailable.\n"); onkey->key_power = !of_property_read_bool(pdev->dev.of_node, "dlg,disable-key-power"); @@ -239,11 +238,9 @@ static int da9063_onkey_probe(struct platform_device *pdev) NULL, da9063_onkey_irq_handler, IRQF_TRIGGER_LOW | IRQF_ONESHOT, "ONKEY", onkey); - if (error) { - dev_err(&pdev->dev, - "Failed to request IRQ %d: %d\n", irq, error); - return error; - } + if (error) + return dev_err_probe(&pdev->dev, error, + "Failed to allocate onkey IRQ\n"); error = dev_pm_set_wake_irq(&pdev->dev, irq); if (error) From patchwork Tue Jul 16 08:22:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734142 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FD1EC3DA59 for ; Tue, 16 Jul 2024 08:23:58 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:23:49 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426059" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:48 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 10FD84005B53; Tue, 16 Jul 2024 17:23:46 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 22/31] dt-bindings: mfd: Convert da9063 to yaml Date: Tue, 16 Jul 2024 09:22:33 +0100 Message-ID: <20240716082255.56551-23-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:58 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16548 From: Conor Dooley commit 361104b05684caa3491b41cd6734474ecf4b80c2 upstream. Convert the dt binding for the da9063/da9063l to yaml. Signed-off-by: Conor Dooley Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220606201343.514391-4-mail@conchuod.ie [biju: squashed the commits 42839dcafd0a("dt-bindings: mfd: Add missing (unevaluated|additional)Properties on child nodes") and c15c19dd4eb8("dt-bindings: mfd: dlg,da9063: Add missing regulator patterns")] Signed-off-by: Biju Das --- .../devicetree/bindings/mfd/da9063.txt | 111 --------------- .../devicetree/bindings/mfd/dlg,da9063.yaml | 133 ++++++++++++++++++ .../devicetree/bindings/trivial-devices.yaml | 2 - MAINTAINERS | 1 + 4 files changed, 134 insertions(+), 113 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mfd/da9063.txt create mode 100644 Documentation/devicetree/bindings/mfd/dlg,da9063.yaml diff --git a/Documentation/devicetree/bindings/mfd/da9063.txt b/Documentation/devicetree/bindings/mfd/da9063.txt deleted file mode 100644 index 8da879935c59..000000000000 --- a/Documentation/devicetree/bindings/mfd/da9063.txt +++ /dev/null @@ -1,111 +0,0 @@ -* Dialog DA9063/DA9063L Power Management Integrated Circuit (PMIC) - -DA9093 consists of a large and varied group of sub-devices (I2C Only): - -Device Supply Names Description ------- ------------ ----------- -da9063-regulator : : LDOs & BUCKs -da9063-onkey : : On Key -da9063-rtc : : Real-Time Clock (DA9063 only) -da9063-watchdog : : Watchdog - -====== - -Required properties: - -- compatible : Should be "dlg,da9063" or "dlg,da9063l" -- reg : Specifies the I2C slave address (this defaults to 0x58 but it can be - modified to match the chip's OTP settings). -- interrupts : IRQ line information. -- interrupt-controller - -Sub-nodes: - -- regulators : This node defines the settings for the LDOs and BUCKs. - The DA9063(L) regulators are bound using their names listed below: - - bcore1 : BUCK CORE1 - bcore2 : BUCK CORE2 - bpro : BUCK PRO - bmem : BUCK MEM - bio : BUCK IO - bperi : BUCK PERI - ldo1 : LDO_1 (DA9063 only) - ldo2 : LDO_2 (DA9063 only) - ldo3 : LDO_3 - ldo4 : LDO_4 (DA9063 only) - ldo5 : LDO_5 (DA9063 only) - ldo6 : LDO_6 (DA9063 only) - ldo7 : LDO_7 - ldo8 : LDO_8 - ldo9 : LDO_9 - ldo10 : LDO_10 (DA9063 only) - ldo11 : LDO_11 - - The component follows the standard regulator framework and the bindings - details of individual regulator device can be found in: - Documentation/devicetree/bindings/regulator/regulator.txt - -- rtc : This node defines settings for the Real-Time Clock associated with - the DA9063 only. The RTC is not present in DA9063L. There are currently - no entries in this binding, however compatible = "dlg,da9063-rtc" should - be added if a node is created. - -- onkey : This node defines the OnKey settings for controlling the key - functionality of the device. The node should contain the compatible property - with the value "dlg,da9063-onkey". - - Optional onkey properties: - - - dlg,disable-key-power : Disable power-down using a long key-press. If this - entry exists the OnKey driver will remove support for the KEY_POWER key - press. If this entry does not exist then by default the key-press - triggered power down is enabled and the OnKey will support both KEY_POWER - and KEY_SLEEP. - -- watchdog : This node defines settings for the Watchdog timer associated - with the DA9063 and DA9063L. There are currently no entries in this - binding, however compatible = "dlg,da9063-watchdog" should be added - if a node is created. - - -Example: - - pmic0: da9063@58 { - compatible = "dlg,da9063" - reg = <0x58>; - interrupt-parent = <&gpio6>; - interrupts = <11 IRQ_TYPE_LEVEL_LOW>; - interrupt-controller; - - rtc { - compatible = "dlg,da9063-rtc"; - }; - - wdt { - compatible = "dlg,da9063-watchdog"; - }; - - onkey { - compatible = "dlg,da9063-onkey"; - dlg,disable-key-power; - }; - - regulators { - DA9063_BCORE1: bcore1 { - regulator-name = "BCORE1"; - regulator-min-microvolt = <300000>; - regulator-max-microvolt = <1570000>; - regulator-min-microamp = <500000>; - regulator-max-microamp = <2000000>; - regulator-boot-on; - }; - DA9063_LDO11: ldo11 { - regulator-name = "LDO_11"; - regulator-min-microvolt = <900000>; - regulator-max-microvolt = <3600000>; - regulator-boot-on; - }; - }; - }; - diff --git a/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml new file mode 100644 index 000000000000..c33df9ca49ab --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml @@ -0,0 +1,133 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/dlg,da9063.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Dialog DA9063/DA9063L Power Management Integrated Circuit (PMIC) + +maintainers: + - Steve Twiss + +description: | + For device-tree bindings of other sub-modules refer to the binding documents + under the respective sub-system directories. + +properties: + compatible: + enum: + - dlg,da9063 + - dlg,da9063l + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + + dlg,use-sw-pm: + type: boolean + description: + Disable the watchdog during suspend. + Only use this option if you can't use the watchdog automatic suspend + function during a suspend (see register CONTROL_B). + + watchdog: + type: object + $ref: /schemas/watchdog/watchdog.yaml# + unevaluatedProperties: false + properties: + compatible: + const: dlg,da9063-watchdog + + rtc: + type: object + $ref: /schemas/rtc/rtc.yaml# + unevaluatedProperties: false + properties: + compatible: + const: dlg,da9063-rtc + + onkey: + type: object + $ref: /schemas/input/input.yaml# + unevaluatedProperties: false + properties: + compatible: + const: dlg,da9063-onkey + + dlg,disable-key-power: + type: boolean + description: | + Disable power-down using a long key-press. + If this entry does not exist then by default the key-press triggered + power down is enabled and the OnKey will support both KEY_POWER and + KEY_SLEEP. + + regulators: + type: object + additionalProperties: false + patternProperties: + "^(ldo([1-9]|1[01])|bcore([1-2]|s-merged)|b(pro|mem|io|peri)|bmem-bio-merged)$": + $ref: /schemas/regulator/regulator.yaml + unevaluatedProperties: false + +required: + - compatible + - reg + - interrupts + - interrupt-controller + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + pmic@58 { + compatible = "dlg,da9063"; + reg = <0x58>; + #interrupt-cells = <2>; + interrupt-parent = <&gpio6>; + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + + rtc { + compatible = "dlg,da9063-rtc"; + }; + + watchdog { + compatible = "dlg,da9063-watchdog"; + }; + + onkey { + compatible = "dlg,da9063-onkey"; + dlg,disable-key-power; + }; + + regulators { + regulator-bcore1 { + regulator-name = "BCORE1"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1570000>; + regulator-min-microamp = <500000>; + regulator-max-microamp = <2000000>; + regulator-boot-on; + }; + regulator-ldo11 { + regulator-name = "LDO_11"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <3600000>; + regulator-boot-on; + }; + }; + }; + }; +... diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index ab623ba930d5..a52eeeff5cc0 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -68,8 +68,6 @@ properties: - devantech,srf10 # DA9053: flexible system level PMIC with multicore support - dlg,da9053 - # DA9063: system PMIC for quad-core application processors - - dlg,da9063 # DMARD09: 3-axis Accelerometer - domintech,dmard09 # DMARD10: 3-axis Accelerometer diff --git a/MAINTAINERS b/MAINTAINERS index ab7997f96fed..46b2a9fd5ed6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5123,6 +5123,7 @@ S: Supported W: http://www.dialog-semiconductor.com/products F: Documentation/devicetree/bindings/input/da90??-onkey.txt F: Documentation/devicetree/bindings/mfd/da90*.txt +F: Documentation/devicetree/bindings/mfd/da90*.yaml F: Documentation/devicetree/bindings/regulator/da92*.txt F: Documentation/devicetree/bindings/regulator/slg51000.txt F: Documentation/devicetree/bindings/sound/da[79]*.txt From patchwork Tue Jul 16 08:22:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFEA4C3DA61 for ; Tue, 16 Jul 2024 08:23:58 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:23:51 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426063" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:50 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 4D0DD4016D5E; Tue, 16 Jul 2024 17:23:49 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 23/31] dt-bindings: watchdog: da9062-wdt: convert txt to yaml Date: Tue, 16 Jul 2024 09:22:34 +0100 Message-ID: <20240716082255.56551-24-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:58 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16549 From: Nik Bune commit bd888a4377ae10303ba8c967dfccf2a1e4bbdcd1 upstream. Convert txt file to yaml. Add a mainterner block. Took a value from dlg,da9063 PMIC. Signed-off-by: Nik Bune Reviewed-by: Guenter Roeck Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231014170434.159310-1-n2h9z4@gmail.com Signed-off-by: Rob Herring Signed-off-by: Biju Das --- .../bindings/watchdog/da9062-wdt.txt | 28 ----------- .../watchdog/dlg,da9062-watchdog.yaml | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 28 deletions(-) delete mode 100644 Documentation/devicetree/bindings/watchdog/da9062-wdt.txt create mode 100644 Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml diff --git a/Documentation/devicetree/bindings/watchdog/da9062-wdt.txt b/Documentation/devicetree/bindings/watchdog/da9062-wdt.txt deleted file mode 100644 index 950e4fba8dbc..000000000000 --- a/Documentation/devicetree/bindings/watchdog/da9062-wdt.txt +++ /dev/null @@ -1,28 +0,0 @@ -* Dialog Semiconductor DA9062/61 Watchdog Timer - -Required properties: - -- compatible: should be one of the following valid compatible string lines: - "dlg,da9061-watchdog", "dlg,da9062-watchdog" - "dlg,da9062-watchdog" - -Optional properties: -- dlg,use-sw-pm: Add this property to disable the watchdog during suspend. - Only use this option if you can't use the watchdog automatic suspend - function during a suspend (see register CONTROL_B). - -Example: DA9062 - - pmic0: da9062@58 { - watchdog { - compatible = "dlg,da9062-watchdog"; - }; - }; - -Example: DA9061 using a fall-back compatible for the DA9062 watchdog driver - - pmic0: da9061@58 { - watchdog { - compatible = "dlg,da9061-watchdog", "dlg,da9062-watchdog"; - }; - }; diff --git a/Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml b/Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml new file mode 100644 index 000000000000..f058628bb632 --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/dlg,da9062-watchdog.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Dialog Semiconductor DA9062/61 Watchdog Timer + +maintainers: + - Steve Twiss + +allOf: + - $ref: watchdog.yaml# + +properties: + compatible: + enum: + - dlg,da9061-watchdog + - dlg,da9062-watchdog + + dlg,use-sw-pm: + type: boolean + description: + Add this property to disable the watchdog during suspend. + Only use this option if you can't use the watchdog automatic suspend + function during a suspend (see register CONTROL_B). + + dlg,wdt-sd: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] + description: + Set what happens on watchdog timeout. If this bit is set the + watchdog timeout triggers SHUTDOWN, if cleared the watchdog triggers + POWERDOWN. Can be 0 or 1. Only use this option if you want to change the + default chip's OTP setting for WATCHDOG_SD bit. If this property is NOT + set the WATCHDOG_SD bit and on timeout watchdog behavior will match the + chip's OTP settings. + +required: + - compatible + +unevaluatedProperties: false + +examples: + - | + watchdog { + compatible = "dlg,da9062-watchdog"; + dlg,use-sw-pm; + dlg,wdt-sd = <1>; + }; From patchwork Tue Jul 16 08:22:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734141 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B92CC3DA49 for ; Tue, 16 Jul 2024 08:23:58 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5834.1721118233763180917 for ; Tue, 16 Jul 2024 01:23:53 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467762" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:53 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 886774016D5E; Tue, 16 Jul 2024 17:23:51 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 24/31] dt-bindings: mfd: da9062: Update watchdog description Date: Tue, 16 Jul 2024 09:22:35 +0100 Message-ID: <20240716082255.56551-25-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:58 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16550 commit 12f0a4cc845286f331239c52282aab283a0392e5 upstream. Update watchdog description by referring to dlg,da9062-watchdog binding file. Update MAINTAINERS entries. Fixes: bd888a4377ae ("dt-bindings: watchdog: da9062-wdt: convert txt to yaml") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Acked-by: Conor Dooley Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20240131102656.3379-2-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones Signed-off-by: Biju Das --- Documentation/devicetree/bindings/mfd/da9062.txt | 2 +- MAINTAINERS | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/da9062.txt b/Documentation/devicetree/bindings/mfd/da9062.txt index bab0d0e66cb3..056a6cb761e2 100644 --- a/Documentation/devicetree/bindings/mfd/da9062.txt +++ b/Documentation/devicetree/bindings/mfd/da9062.txt @@ -85,7 +85,7 @@ Sub-nodes: - onkey : See ../input/da9062-onkey.txt -- watchdog: See ../watchdog/da9062-watchdog.txt +- watchdog: See ../watchdog/dlg,da9062-watchdog.yaml - thermal : See ../thermal/da9062-thermal.txt diff --git a/MAINTAINERS b/MAINTAINERS index 46b2a9fd5ed6..83b04669b7d0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5128,7 +5128,7 @@ F: Documentation/devicetree/bindings/regulator/da92*.txt F: Documentation/devicetree/bindings/regulator/slg51000.txt F: Documentation/devicetree/bindings/sound/da[79]*.txt F: Documentation/devicetree/bindings/thermal/da90??-thermal.txt -F: Documentation/devicetree/bindings/watchdog/da90??-wdt.txt +F: Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml F: Documentation/hwmon/da90??.rst F: drivers/gpio/gpio-da90??.c F: drivers/hwmon/da90??-hwmon.c From patchwork Tue Jul 16 08:22:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734144 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB9D9C41513 for ; Tue, 16 Jul 2024 08:23:58 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:23:55 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426073" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:55 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id C1D384016D5E; Tue, 16 Jul 2024 17:23:53 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 25/31] dt-bindings: mfd: dlg,da9063: Update watchdog child node Date: Tue, 16 Jul 2024 09:22:36 +0100 Message-ID: <20240716082255.56551-26-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:58 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16551 commit 19c993f29e8ed2c4e34f4696b9cd0184e404c1fb upstream. Update watchdog child node by referring to dlg,da9062-watchdog binding file and drop its definition from this file. Signed-off-by: Biju Das Acked-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20240131102656.3379-3-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones Signed-off-by: Biju Das --- .../devicetree/bindings/mfd/dlg,da9063.yaml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml index c33df9ca49ab..d666b85c19f7 100644 --- a/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml +++ b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml @@ -30,21 +30,6 @@ properties: "#interrupt-cells": const: 2 - dlg,use-sw-pm: - type: boolean - description: - Disable the watchdog during suspend. - Only use this option if you can't use the watchdog automatic suspend - function during a suspend (see register CONTROL_B). - - watchdog: - type: object - $ref: /schemas/watchdog/watchdog.yaml# - unevaluatedProperties: false - properties: - compatible: - const: dlg,da9063-watchdog - rtc: type: object $ref: /schemas/rtc/rtc.yaml# @@ -77,6 +62,9 @@ properties: $ref: /schemas/regulator/regulator.yaml unevaluatedProperties: false + watchdog: + $ref: /schemas/watchdog/dlg,da9062-watchdog.yaml + required: - compatible - reg From patchwork Tue Jul 16 08:22:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734145 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADA3CC3DA5D for ; Tue, 16 Jul 2024 08:23:58 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:23:58 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426079" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:23:57 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 0C0464005B53; Tue, 16 Jul 2024 17:23:55 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 26/31] dt-bindings: input: Convert da906{1,2,3} onkey to json-schema Date: Tue, 16 Jul 2024 09:22:37 +0100 Message-ID: <20240716082255.56551-27-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:23:58 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16552 commit e2fcaf4c067099a1ebcdb37903e630ad0f55ed2e upstream. Convert the da906{1,2,3} onkey device tree binding documentation to json-schema. Update MAINTAINERS entries, description and onkey property by referring to dlg,da9062-onkey binding file. Signed-off-by: Biju Das Reviewed-by: Conor Dooley Reviewed-by: Krzysztof Kozlowski Acked-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20240131102656.3379-4-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones Signed-off-by: Biju Das --- .../bindings/input/da9062-onkey.txt | 47 ------------------- .../bindings/input/dlg,da9062-onkey.yaml | 39 +++++++++++++++ .../devicetree/bindings/mfd/da9062.txt | 2 +- .../devicetree/bindings/mfd/dlg,da9063.yaml | 15 +----- MAINTAINERS | 2 +- 5 files changed, 42 insertions(+), 63 deletions(-) delete mode 100644 Documentation/devicetree/bindings/input/da9062-onkey.txt create mode 100644 Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml diff --git a/Documentation/devicetree/bindings/input/da9062-onkey.txt b/Documentation/devicetree/bindings/input/da9062-onkey.txt deleted file mode 100644 index 5f9fbc68e58a..000000000000 --- a/Documentation/devicetree/bindings/input/da9062-onkey.txt +++ /dev/null @@ -1,47 +0,0 @@ -* Dialog DA9061/62/63 OnKey Module - -This module is part of the DA9061/DA9062/DA9063. For more details about entire -DA9062 and DA9061 chips see Documentation/devicetree/bindings/mfd/da9062.txt -For DA9063 see Documentation/devicetree/bindings/mfd/da9063.txt - -This module provides the KEY_POWER event. - -Required properties: - -- compatible: should be one of the following valid compatible string lines: - "dlg,da9061-onkey", "dlg,da9062-onkey" - "dlg,da9062-onkey" - "dlg,da9063-onkey" - -Optional properties: - -- dlg,disable-key-power : Disable power-down using a long key-press. If this - entry exists the OnKey driver will remove support for the KEY_POWER key - press when triggered using a long press of the OnKey. - -Example: DA9063 - - pmic0: da9063@58 { - onkey { - compatible = "dlg,da9063-onkey"; - dlg,disable-key-power; - }; - }; - -Example: DA9062 - - pmic0: da9062@58 { - onkey { - compatible = "dlg,da9062-onkey"; - dlg,disable-key-power; - }; - }; - -Example: DA9061 using a fall-back compatible for the DA9062 onkey driver - - pmic0: da9061@58 { - onkey { - compatible = "dlg,da9061-onkey", "dlg,da9062-onkey"; - dlg,disable-key-power; - }; - }; diff --git a/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml b/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml new file mode 100644 index 000000000000..757a522c102c --- /dev/null +++ b/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/dlg,da9062-onkey.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Dialog DA9061/62/63 OnKey Module + +maintainers: + - Biju Das + +description: | + This module is part of the DA9061/DA9062/DA9063. For more details about entire + DA9062 and DA9061 chips see Documentation/devicetree/bindings/mfd/da9062.txt + For DA9063 see Documentation/devicetree/bindings/mfd/dlg,da9063.yaml + + This module provides the KEY_POWER event. + +properties: + compatible: + oneOf: + - enum: + - dlg,da9062-onkey + - dlg,da9063-onkey + - items: + - const: dlg,da9061-onkey + - const: dlg,da9062-onkey + + dlg,disable-key-power: + type: boolean + description: + Disable power-down using a long key-press. If this entry exists + the OnKey driver will remove support for the KEY_POWER key press + when triggered using a long press of the OnKey. + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/mfd/da9062.txt b/Documentation/devicetree/bindings/mfd/da9062.txt index 056a6cb761e2..a788a31587fa 100644 --- a/Documentation/devicetree/bindings/mfd/da9062.txt +++ b/Documentation/devicetree/bindings/mfd/da9062.txt @@ -83,7 +83,7 @@ Sub-nodes: with the DA9062. There are currently no entries in this binding, however compatible = "dlg,da9062-rtc" should be added if a node is created. -- onkey : See ../input/da9062-onkey.txt +- onkey : See ../input/dlg,da9062-onkey.yaml - watchdog: See ../watchdog/dlg,da9062-watchdog.yaml diff --git a/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml index d666b85c19f7..17c6341bf6fc 100644 --- a/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml +++ b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml @@ -39,20 +39,7 @@ properties: const: dlg,da9063-rtc onkey: - type: object - $ref: /schemas/input/input.yaml# - unevaluatedProperties: false - properties: - compatible: - const: dlg,da9063-onkey - - dlg,disable-key-power: - type: boolean - description: | - Disable power-down using a long key-press. - If this entry does not exist then by default the key-press triggered - power down is enabled and the OnKey will support both KEY_POWER and - KEY_SLEEP. + $ref: /schemas/input/dlg,da9062-onkey.yaml regulators: type: object diff --git a/MAINTAINERS b/MAINTAINERS index 83b04669b7d0..4146059a7144 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5121,7 +5121,7 @@ DIALOG SEMICONDUCTOR DRIVERS M: Support Opensource S: Supported W: http://www.dialog-semiconductor.com/products -F: Documentation/devicetree/bindings/input/da90??-onkey.txt +F: Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml F: Documentation/devicetree/bindings/mfd/da90*.txt F: Documentation/devicetree/bindings/mfd/da90*.yaml F: Documentation/devicetree/bindings/regulator/da92*.txt From patchwork Tue Jul 16 08:22:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734146 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFDEEC41513 for ; Tue, 16 Jul 2024 08:24:08 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web10.5938.1721118211284299661 for ; Tue, 16 Jul 2024 01:24:00 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426083" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:24:00 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 504944016D5E; Tue, 16 Jul 2024 17:23:58 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 27/31] dt-bindings: thermal: Convert da906{1,2} thermal to json-schema Date: Tue, 16 Jul 2024 09:22:38 +0100 Message-ID: <20240716082255.56551-28-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:24:08 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16553 commit fddee1e686de077c80ad9dd61f4a50fa1d8b6605 upstream. Convert the da906{1,2} thermal device tree binding documentation to json-schema. Update MAINTAINERS entries and description by referring to dlg,da9062-thermal.yaml binding file. Signed-off-by: Biju Das Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20240131102656.3379-5-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones Signed-off-by: Biju Das --- .../devicetree/bindings/mfd/da9062.txt | 2 +- .../bindings/thermal/da9062-thermal.txt | 36 ------------------- .../bindings/thermal/dlg,da9062-thermal.yaml | 35 ++++++++++++++++++ MAINTAINERS | 2 +- 4 files changed, 37 insertions(+), 38 deletions(-) delete mode 100644 Documentation/devicetree/bindings/thermal/da9062-thermal.txt create mode 100644 Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml diff --git a/Documentation/devicetree/bindings/mfd/da9062.txt b/Documentation/devicetree/bindings/mfd/da9062.txt index a788a31587fa..4a5167c2d35f 100644 --- a/Documentation/devicetree/bindings/mfd/da9062.txt +++ b/Documentation/devicetree/bindings/mfd/da9062.txt @@ -87,7 +87,7 @@ Sub-nodes: - watchdog: See ../watchdog/dlg,da9062-watchdog.yaml -- thermal : See ../thermal/da9062-thermal.txt +- thermal : See ../thermal/dlg,da9062-thermal.yaml Example: diff --git a/Documentation/devicetree/bindings/thermal/da9062-thermal.txt b/Documentation/devicetree/bindings/thermal/da9062-thermal.txt deleted file mode 100644 index e241bb5a5584..000000000000 --- a/Documentation/devicetree/bindings/thermal/da9062-thermal.txt +++ /dev/null @@ -1,36 +0,0 @@ -* Dialog DA9062/61 TJUNC Thermal Module - -This module is part of the DA9061/DA9062. For more details about entire -DA9062 and DA9061 chips see Documentation/devicetree/bindings/mfd/da9062.txt - -Junction temperature thermal module uses an interrupt signal to identify -high THERMAL_TRIP_HOT temperatures for the PMIC device. - -Required properties: - -- compatible: should be one of the following valid compatible string lines: - "dlg,da9061-thermal", "dlg,da9062-thermal" - "dlg,da9062-thermal" - -Optional properties: - -- polling-delay-passive : Specify the polling period, measured in - milliseconds, between thermal zone device update checks. - -Example: DA9062 - - pmic0: da9062@58 { - thermal { - compatible = "dlg,da9062-thermal"; - polling-delay-passive = <3000>; - }; - }; - -Example: DA9061 using a fall-back compatible for the DA9062 onkey driver - - pmic0: da9061@58 { - thermal { - compatible = "dlg,da9061-thermal", "dlg,da9062-thermal"; - polling-delay-passive = <3000>; - }; - }; diff --git a/Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml b/Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml new file mode 100644 index 000000000000..206635f74850 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/dlg,da9062-thermal.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Dialog DA9062/61 TJUNC Thermal Module + +maintainers: + - Biju Das + +description: | + This module is part of the DA9061/DA9062. For more details about entire + DA9062 and DA9061 chips see Documentation/devicetree/bindings/mfd/da9062.txt + + Junction temperature thermal module uses an interrupt signal to identify + high THERMAL_TRIP_HOT temperatures for the PMIC device. + +properties: + compatible: + oneOf: + - const: dlg,da9062-thermal + - items: + - const: dlg,da9061-thermal + - const: dlg,da9062-thermal + + polling-delay-passive: + description: + Specify the polling period, measured in milliseconds, between + thermal zone device update checks. + +required: + - compatible + +additionalProperties: false diff --git a/MAINTAINERS b/MAINTAINERS index 4146059a7144..4e2d9ed016ab 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5127,7 +5127,7 @@ F: Documentation/devicetree/bindings/mfd/da90*.yaml F: Documentation/devicetree/bindings/regulator/da92*.txt F: Documentation/devicetree/bindings/regulator/slg51000.txt F: Documentation/devicetree/bindings/sound/da[79]*.txt -F: Documentation/devicetree/bindings/thermal/da90??-thermal.txt +F: Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml F: Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml F: Documentation/hwmon/da90??.rst F: drivers/gpio/gpio-da90??.c From patchwork Tue Jul 16 08:22:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02904C3DA5D for ; Tue, 16 Jul 2024 08:24:09 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5837.1721118242888908646 for ; Tue, 16 Jul 2024 01:24:03 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467777" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:24:02 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 95E134016D5E; Tue, 16 Jul 2024 17:24:00 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 28/31] dt-bindings: mfd: dlg,da9063: Sort child devices Date: Tue, 16 Jul 2024 09:22:39 +0100 Message-ID: <20240716082255.56551-29-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:24:09 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16554 commit ae3a0d709c240bc88c741d624d119ae96081d545 upstream. Sort child devices alphabetically. Signed-off-by: Biju Das Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20240131102656.3379-6-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones Signed-off-by: Biju Das --- .../devicetree/bindings/mfd/dlg,da9063.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml index 17c6341bf6fc..d4b8153bda77 100644 --- a/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml +++ b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml @@ -30,14 +30,6 @@ properties: "#interrupt-cells": const: 2 - rtc: - type: object - $ref: /schemas/rtc/rtc.yaml# - unevaluatedProperties: false - properties: - compatible: - const: dlg,da9063-rtc - onkey: $ref: /schemas/input/dlg,da9062-onkey.yaml @@ -49,6 +41,14 @@ properties: $ref: /schemas/regulator/regulator.yaml unevaluatedProperties: false + rtc: + type: object + $ref: /schemas/rtc/rtc.yaml# + unevaluatedProperties: false + properties: + compatible: + const: dlg,da9063-rtc + watchdog: $ref: /schemas/watchdog/dlg,da9062-watchdog.yaml From patchwork Tue Jul 16 08:22:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734147 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFD35C3DA49 for ; Tue, 16 Jul 2024 08:24:08 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5837.1721118242888908646 for ; Tue, 16 Jul 2024 01:24:05 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467785" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:24:04 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D5C6D4005B53; Tue, 16 Jul 2024 17:24:02 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 29/31] dt-bindings: mfd: dlg,da9063: Convert da9062 to json-schema Date: Tue, 16 Jul 2024 09:22:40 +0100 Message-ID: <20240716082255.56551-30-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:24:08 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16555 commit f1eb64bf6d4bef5295ab7633874960fbcfadca46 upstream. Convert the da9062 PMIC device tree binding documentation to json-schema. Document the missing gpio child node for da9062. While at it, update description with link to product information and example. The missing child node with of_compatible defined in MFD_CELL_OF is causing the below warning message: da9062-gpio: Failed to locate of_node [id: -1] So, make all child nodes with of_compatible defined in struct mfd_cell as required property for da906{1,2} devices. The "gpio-controller" and "#gpio-cells" properties are defined in the parent instead of gpio child node as there are existing driver users based on these parent properties. Signed-off-by: Biju Das Reviewed-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Acked-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20240131102656.3379-7-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones Signed-off-by: Biju Das --- .../bindings/input/dlg,da9062-onkey.yaml | 3 +- .../devicetree/bindings/mfd/da9062.txt | 123 ---------- .../devicetree/bindings/mfd/dlg,da9063.yaml | 215 +++++++++++++++++- .../bindings/thermal/dlg,da9062-thermal.yaml | 2 +- 4 files changed, 212 insertions(+), 131 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mfd/da9062.txt diff --git a/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml b/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml index 757a522c102c..1480d95421e1 100644 --- a/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml +++ b/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml @@ -11,8 +11,7 @@ maintainers: description: | This module is part of the DA9061/DA9062/DA9063. For more details about entire - DA9062 and DA9061 chips see Documentation/devicetree/bindings/mfd/da9062.txt - For DA9063 see Documentation/devicetree/bindings/mfd/dlg,da9063.yaml + DA906{1,2,3} chips see Documentation/devicetree/bindings/mfd/dlg,da9063.yaml This module provides the KEY_POWER event. diff --git a/Documentation/devicetree/bindings/mfd/da9062.txt b/Documentation/devicetree/bindings/mfd/da9062.txt deleted file mode 100644 index 4a5167c2d35f..000000000000 --- a/Documentation/devicetree/bindings/mfd/da9062.txt +++ /dev/null @@ -1,123 +0,0 @@ -* Dialog DA9062 Power Management Integrated Circuit (PMIC) - -Product information for the DA9062 and DA9061 devices can be found here: -- https://www.dialog-semiconductor.com/products/da9062 -- https://www.dialog-semiconductor.com/products/da9061 - -The DA9062 PMIC consists of: - -Device Supply Names Description ------- ------------ ----------- -da9062-regulator : : LDOs & BUCKs -da9062-rtc : : Real-Time Clock -da9062-onkey : : On Key -da9062-watchdog : : Watchdog Timer -da9062-thermal : : Thermal -da9062-gpio : : GPIOs - -The DA9061 PMIC consists of: - -Device Supply Names Description ------- ------------ ----------- -da9062-regulator : : LDOs & BUCKs -da9062-onkey : : On Key -da9062-watchdog : : Watchdog Timer -da9062-thermal : : Thermal - -====== - -Required properties: - -- compatible : Should be - "dlg,da9062" for DA9062 - "dlg,da9061" for DA9061 -- reg : Specifies the I2C slave address (this defaults to 0x58 but it can be - modified to match the chip's OTP settings). -- interrupts : IRQ line information. -- interrupt-controller - -See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for -further information on IRQ bindings. - -Optional properties: - -- gpio-controller : Marks the device as a gpio controller. -- #gpio-cells : Should be two. The first cell is the pin number and the - second cell is used to specify the gpio polarity. - -See Documentation/devicetree/bindings/gpio/gpio.txt for further information on -GPIO bindings. - -Sub-nodes: - -- regulators : This node defines the settings for the LDOs and BUCKs. - The DA9062 regulators are bound using their names listed below: - - buck1 : BUCK_1 - buck2 : BUCK_2 - buck3 : BUCK_3 - buck4 : BUCK_4 - ldo1 : LDO_1 - ldo2 : LDO_2 - ldo3 : LDO_3 - ldo4 : LDO_4 - - The DA9061 regulators are bound using their names listed below: - - buck1 : BUCK_1 - buck2 : BUCK_2 - buck3 : BUCK_3 - ldo1 : LDO_1 - ldo2 : LDO_2 - ldo3 : LDO_3 - ldo4 : LDO_4 - - The component follows the standard regulator framework and the bindings - details of individual regulator device can be found in: - Documentation/devicetree/bindings/regulator/regulator.txt - - regulator-initial-mode may be specified for buck regulators using mode values - from include/dt-bindings/regulator/dlg,da9063-regulator.h. - -- rtc : This node defines settings required for the Real-Time Clock associated - with the DA9062. There are currently no entries in this binding, however - compatible = "dlg,da9062-rtc" should be added if a node is created. - -- onkey : See ../input/dlg,da9062-onkey.yaml - -- watchdog: See ../watchdog/dlg,da9062-watchdog.yaml - -- thermal : See ../thermal/dlg,da9062-thermal.yaml - -Example: - - pmic0: da9062@58 { - compatible = "dlg,da9062"; - reg = <0x58>; - interrupt-parent = <&gpio6>; - interrupts = <11 IRQ_TYPE_LEVEL_LOW>; - interrupt-controller; - - rtc { - compatible = "dlg,da9062-rtc"; - }; - - regulators { - DA9062_BUCK1: buck1 { - regulator-name = "BUCK1"; - regulator-min-microvolt = <300000>; - regulator-max-microvolt = <1570000>; - regulator-min-microamp = <500000>; - regulator-max-microamp = <2000000>; - regulator-initial-mode = ; - regulator-boot-on; - }; - DA9062_LDO1: ldo1 { - regulator-name = "LDO_1"; - regulator-min-microvolt = <900000>; - regulator-max-microvolt = <3600000>; - regulator-boot-on; - }; - }; - }; - diff --git a/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml index d4b8153bda77..8a61bb6964bf 100644 --- a/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml +++ b/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/mfd/dlg,da9063.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Dialog DA9063/DA9063L Power Management Integrated Circuit (PMIC) +title: Dialog DA906{3L,3,2,1} Power Management Integrated Circuit (PMIC) maintainers: - Steve Twiss @@ -12,10 +12,17 @@ maintainers: description: | For device-tree bindings of other sub-modules refer to the binding documents under the respective sub-system directories. + Product information for the DA906{3L,3,2,1} devices can be found here: + - https://www.dialog-semiconductor.com/products/da9063l + - https://www.dialog-semiconductor.com/products/da9063 + - https://www.dialog-semiconductor.com/products/da9062 + - https://www.dialog-semiconductor.com/products/da9061 properties: compatible: enum: + - dlg,da9061 + - dlg,da9062 - dlg,da9063 - dlg,da9063l @@ -30,6 +37,18 @@ properties: "#interrupt-cells": const: 2 + gpio-controller: true + + "#gpio-cells": + const: 2 + + gpio: + type: object + additionalProperties: false + properties: + compatible: + const: dlg,da9062-gpio + onkey: $ref: /schemas/input/dlg,da9062-onkey.yaml @@ -37,7 +56,7 @@ properties: type: object additionalProperties: false patternProperties: - "^(ldo([1-9]|1[01])|bcore([1-2]|s-merged)|b(pro|mem|io|peri)|bmem-bio-merged)$": + "^(ldo([1-9]|1[01])|bcore([1-2]|s-merged)|b(pro|mem|io|peri)|bmem-bio-merged|buck[1-4])$": $ref: /schemas/regulator/regulator.yaml unevaluatedProperties: false @@ -47,16 +66,85 @@ properties: unevaluatedProperties: false properties: compatible: - const: dlg,da9063-rtc + enum: + - dlg,da9062-rtc + - dlg,da9063-rtc + + thermal: + $ref: /schemas/thermal/dlg,da9062-thermal.yaml watchdog: $ref: /schemas/watchdog/dlg,da9062-watchdog.yaml +patternProperties: + "^(.+-hog(-[0-9]+)?)$": + type: object + + required: + - gpio-hog + required: - compatible - reg - - interrupts - - interrupt-controller + +allOf: + - if: + properties: + compatible: + contains: + enum: + - dlg,da9063 + - dlg,da9063l + then: + properties: + gpio-controller: false + "#gpio-cells": false + gpio: false + regulators: + patternProperties: + "^buck[1-4]$": false + thermal: false + required: + - interrupts + - interrupt-controller + + - if: + properties: + compatible: + contains: + enum: + - dlg,da9062 + then: + properties: + regulators: + patternProperties: + "^(ldo([5-9]|10|11)|bcore([1-2]|s-merged)|b(pro|mem|io|peri)|bmem-bio-merged)$": false + required: + - gpio + - onkey + - rtc + - thermal + - watchdog + + - if: + properties: + compatible: + contains: + enum: + - dlg,da9061 + then: + properties: + gpio-controller: false + "#gpio-cells": false + gpio: false + regulators: + patternProperties: + "^(ldo([5-9]|10|11)|bcore([1-2]|s-merged)|b(pro|mem|io|peri)|bmem-bio-merged|buck4)$": false + rtc: false + required: + - onkey + - thermal + - watchdog additionalProperties: false @@ -105,4 +193,121 @@ examples: }; }; }; + + - | + #include + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + pmic@58 { + compatible = "dlg,da9062"; + reg = <0x58>; + gpio-controller; + #gpio-cells = <2>; + + sd0-pwr-sel-hog { + gpio-hog; + gpios = <1 0>; + input; + line-name = "SD0_PWR_SEL"; + }; + + sd1-pwr-sel-hog { + gpio-hog; + gpios = <2 0>; + input; + line-name = "SD1_PWR_SEL"; + }; + + sw-et0-en-hog { + gpio-hog; + gpios = <3 0>; + input; + line-name = "SW_ET0_EN#"; + }; + + pmic-good-hog { + gpio-hog; + gpios = <4 0>; + output-high; + line-name = "PMIC_PGOOD"; + }; + + gpio { + compatible = "dlg,da9062-gpio"; + }; + + onkey { + compatible = "dlg,da9062-onkey"; + }; + + regulators { + buck1 { + regulator-name = "vdd_arm"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1380000>; + regulator-initial-mode = ; + regulator-always-on; + }; + buck2 { + regulator-name = "vdd_soc"; + regulator-min-microvolt = <1150000>; + regulator-max-microvolt = <1380000>; + regulator-initial-mode = ; + regulator-always-on; + }; + buck3 { + regulator-name = "vdd_ddr3"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-initial-mode = ; + regulator-always-on; + }; + buck4 { + regulator-name = "vdd_eth"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-initial-mode = ; + regulator-always-on; + }; + ldo1 { + regulator-name = "vdd_snvs"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-always-on; + }; + ldo2 { + regulator-name = "vdd_high"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-always-on; + }; + ldo3 { + regulator-name = "vdd_eth_io"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + }; + ldo4 { + regulator-name = "vdd_emmc"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + }; + + rtc { + compatible = "dlg,da9062-rtc"; + }; + + thermal { + compatible = "dlg,da9062-thermal"; + }; + + watchdog { + compatible = "dlg,da9062-watchdog"; + dlg,use-sw-pm; + }; + }; + }; ... diff --git a/Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml b/Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml index 206635f74850..e8b2cac41084 100644 --- a/Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml @@ -11,7 +11,7 @@ maintainers: description: | This module is part of the DA9061/DA9062. For more details about entire - DA9062 and DA9061 chips see Documentation/devicetree/bindings/mfd/da9062.txt + DA906{1,2} chips see Documentation/devicetree/bindings/mfd/dlg,da9063.yaml Junction temperature thermal module uses an interrupt signal to identify high THERMAL_TRIP_HOT temperatures for the PMIC device. From patchwork Tue Jul 16 08:22:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734149 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEFEFC3DA59 for ; Tue, 16 Jul 2024 08:24:08 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.5837.1721118242888908646 for ; Tue, 16 Jul 2024 01:24:07 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="211467788" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Jul 2024 17:24:06 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 274774016D5E; Tue, 16 Jul 2024 17:24:04 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 30/31] arm64: dts: renesas: rzg2ul-smarc: Enable PMIC and built-in RTC, GPIO and ONKEY Date: Tue, 16 Jul 2024 09:22:41 +0100 Message-ID: <20240716082255.56551-31-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:24:08 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16556 commit 1aa24b0b4e6f65935418a50c3167adf954a04770 upstream. Enable PMIC DA9062 and the built-in RTC, GPIO and ONKEY modules on the RZ/{G2UL,Five} SMARC EVK development boards. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20240226194715.427597-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven Signed-off-by: Biju Das --- arch/arm64/boot/dts/renesas/rzg2ul-smarc.dtsi | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/rzg2ul-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg2ul-smarc.dtsi index 727e3268a15b..876eb9d60f76 100644 --- a/arch/arm64/boot/dts/renesas/rzg2ul-smarc.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg2ul-smarc.dtsi @@ -5,6 +5,7 @@ * Copyright (C) 2022 Renesas Electronics Corp. */ +#include #include "rzg2ul-smarc-pinfunction.dtsi" #include "rz-smarc-common.dtsi" @@ -23,6 +24,63 @@ &cpu_dai { &i2c0 { clock-frequency = <400000>; + da9062: pmic@58 { + compatible = "dlg,da9062"; + reg = <0x58>; + gpio-controller; + #gpio-cells = <2>; + + gpio { + compatible = "dlg,da9062-gpio"; + }; + + onkey { + compatible = "dlg,da9062-onkey"; + }; + + pmic-good-hog { + gpio-hog; + gpios = <4 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "PMIC_PGOOD"; + }; + + rtc { + compatible = "dlg,da9062-rtc"; + }; + + sd0-pwr-sel-hog { + gpio-hog; + gpios = <1 GPIO_ACTIVE_HIGH>; + input; + line-name = "SD0_PWR_SEL"; + }; + + sd1-pwr-sel-hog { + gpio-hog; + gpios = <2 GPIO_ACTIVE_HIGH>; + input; + line-name = "SD1_PWR_SEL"; + }; + + sw-et0-en-hog { + gpio-hog; + gpios = <3 GPIO_ACTIVE_HIGH>; + input; + line-name = "SW_ET0_EN#"; + }; + + thermal { + compatible = "dlg,da9062-thermal"; + status = "disabled"; + }; + + watchdog { + compatible = "dlg,da9062-watchdog"; + status = "disabled"; + }; + }; + versa3: clock-generator@68 { compatible = "renesas,5p35023"; reg = <0x68>; From patchwork Tue Jul 16 08:22:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13734157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D44C1C3DA59 for ; Tue, 16 Jul 2024 08:24:18 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlie6.idc.renesas.com [210.160.252.172]) by mx.groups.io with SMTP id smtpd.web11.5841.1721118249637042515 for ; Tue, 16 Jul 2024 01:24:09 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: bp.renesas.com, ip: 210.160.252.172, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="6.09,211,1716217200"; d="scan'208";a="215426100" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Jul 2024 17:24:09 +0900 Received: from localhost.localdomain (unknown [10.226.92.125]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 6375E4005B53; Tue, 16 Jul 2024 17:24:07 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Biju Das , Lad Prabhakar Subject: [PATCH 5.10.y-cip 31/31] arm64: defconfig: Enable Renesas DA9062 PMIC Date: Tue, 16 Jul 2024 09:22:42 +0100 Message-ID: <20240716082255.56551-32-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> References: <20240716082255.56551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jul 2024 08:24:18 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/16557 commit 3fe8d529076f6ef94c30c9afa0b0aeb49fc9509d upstream. Enable the config for the Renesas DA9062 PMIC and the built-in RTC, GPIO and ONKEY drivers as it is populated on the RZ/G2UL SMARC EVK development board. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20240227130010.45361-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven Signed-off-by: Biju Das --- arch/arm64/configs/defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index a26ae513bb72..8a2f7a67cdac 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -384,6 +384,7 @@ CONFIG_TOUCHSCREEN_ATMEL_MXT=m CONFIG_INPUT_MISC=y CONFIG_INPUT_PM8941_PWRKEY=y CONFIG_INPUT_PM8XXX_VIBRATOR=m +CONFIG_INPUT_DA9063_ONKEY=m CONFIG_INPUT_HISI_POWERKEY=y # CONFIG_SERIO_SERPORT is not set CONFIG_SERIO_AMBAKMI=y @@ -476,6 +477,7 @@ CONFIG_SPI_SH_MSIOF=m CONFIG_SPI_SUN6I=y CONFIG_SPI_SPIDEV=m CONFIG_SPMI=y +CONFIG_PINCTRL_DA9062=m CONFIG_PINCTRL_SINGLE=y CONFIG_PINCTRL_MAX77620=y CONFIG_PINCTRL_OWL=y @@ -574,6 +576,7 @@ CONFIG_MFD_ALTERA_SYSMGR=y CONFIG_MFD_BD9571MWV=y CONFIG_MFD_AXP20X_I2C=y CONFIG_MFD_AXP20X_RSB=y +CONFIG_MFD_DA9062=m CONFIG_MFD_EXYNOS_LPASS=m CONFIG_MFD_HI6421_PMIC=y CONFIG_MFD_HI655X_PMIC=y @@ -837,6 +840,7 @@ CONFIG_RTC_DRV_RV8803=m CONFIG_RTC_DRV_S5M=y CONFIG_RTC_DRV_DS3232=y CONFIG_RTC_DRV_PCF2127=m +CONFIG_RTC_DRV_DA9063=m CONFIG_RTC_DRV_EFI=y CONFIG_RTC_DRV_CROS_EC=y CONFIG_RTC_DRV_S3C=y