Support for Qualcomm QPNP PMIC's
Subsystems (4)
v2 cover Support for Qualcomm QPNP PMIC's
Hello to all,
Here is the second version of the RFC for Qualcomm QPNP PMIC's support. The difference since first version [1] is that now we use platform devices for PMIC peripherals instead of new qpnp-bus. The first patch in the set implements an *of* based parsing of PMIC peripheral resources and adding mfd cell for it. The devicetree node should contain a compatible and reg proparties. The intention was to keep things simple and similar to the other mfd drivers.
The second patch describes the devicetree binding of the slave devices attached to the SPMI interface. The other few patches are example of a qpnp-rtc driver and binding documentation.
Comments are welcome.
regards,
Stan
[1] http://www.spinics.net/lists/linux-arm-msm/msg09745.html
Ivan T. Ivanov (1):
dt: qcom: msm8974: add qpnp-spmi device nodes
Josh Cartwright (1):
mfd: qpnp: add support for Qualcomm QPNP PMICs
Stanimir Varbanov (3):
rtc: add qpnp rtc driver
dt: msm8974: add qpnp rtc device node
dt: rtc: add binding document for qpnp rtc
.../devicetree/bindings/rtc/qcom,rtc-qpnp.txt | 24 + arch/arm/boot/dts/qcom-msm8974.dtsi | 53 +++ drivers/mfd/Kconfig | 15 + drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++ drivers/rtc/Kconfig | 8 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-qpnp.c | 489 ++++++++++++++++++++ 8 files changed, 720 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/rtc/qcom,rtc-qpnp.txt create mode 100644 drivers/mfd/qpnp-spmi.c create mode 100644 drivers/rtc/rtc-qpnp.c
RFC PATCH v2 1/5 mfd: qpnp: add support for Qualcomm QPNP PMICs
From: Josh Cartwright <[email protected]>
The Qualcomm QPNP PMIC chips are components used with the Snapdragon 800 series SoC family. This driver exists largely as a glue mfd component, it exists to be an owner of an SPMI regmap for children devices described in device tree.
--- drivers/mfd/Kconfig | 15 ++++++ drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/qpnp-spmi.c
drivers/mfd/Kconfig +15 -0
@@ -524,6 +524,21 @@ config MFD_PM8921_CORE Say M here if you want to include support for PM8921 chip as a module. This will build a module called "pm8921-core". +config MFD_QPNP_SPMI + tristate "Qualcomm QPNP SPMI PMIC" + depends on ARCH_QCOM || COMPILE_TEST + depends on OF + select MFD_CORE + select REGMAP_SPMI + help + This enables support for the Qualcomm QPNP SPMI PMICs. + These PMICs are currently used with the Snapdragon 800 series of + SoCs. Note, that this will only be useful paired with descriptions + of the independent functions as children nodes in the device tree. + + Say M here if you want to include support for the QPNP SPMI PMIC + series as a module. The module will be called "qpnp-spmi". + config MFD_RDC321X tristate "RDC R-321x southbridge" select MFD_CORE
drivers/mfd/Makefile +1 -0
@@ -153,6 +153,7 @@ obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o obj-$(CONFIG_MFD_PM8921_CORE) += pm8921-core.o ssbi.o +obj-$(CONFIG_MFD_QPNP_SPMI) += qpnp-spmi.o obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o obj-$(CONFIG_MFD_TPS65090) += tps65090.o obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o
drivers/mfd/qpnp-spmi.c new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Re: [RFC PATCH v2 1/5] mfd: qpnp: add support for Qualcomm QPNP PMICs
Quoted 26 lines · Stanimir Varbanov
From: Josh Cartwright <[email protected]>
The Qualcomm QPNP PMIC chips are components used with the Snapdragon 800 series SoC family. This driver exists largely as a glue mfd component, it exists to be an owner of an SPMI regmap for children devices described in device tree.
Signed-off-by Josh Cartwright <[email protected]>Signed-off-by Stanimir Varbanov <[email protected]>--- drivers/mfd/Kconfig | 15 ++++++ drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/qpnp-spmi.cdrivers/mfd/Kconfig +1
-0@@ -524,6 +524,21 @@ config MFD_PM8921_CORE Say M here if you want to include support for PM8921 chip as a module. This will build a module called "pm8921-core". +config MFD_QPNP_SPMI
drivers/mfd/Kconfig config MFD_PM8921_CORE · line 537
Quoted 10 lines
drivers/mfd/Kconfig +10
-0+ tristate "Qualcomm QPNP SPMI PMIC" + depends on ARCH_QCOM || COMPILE_TEST + depends on OF + select MFD_CORE + select REGMAP_SPMI + help + This enables support for the Qualcomm QPNP SPMI PMICs. + These PMICs are currently used with the Snapdragon 800 series of + SoCs. Note, that this will only be useful paired with descriptions + of the independent functions as children nodes in the device tree.
It would be helpful if the expected types of child devices were mentioned here in the help section.
Quoted 24 lines
drivers/mfd/Kconfig +3
-0+ Say M here if you want to include support for the QPNP SPMI PMIC + series as a module. The module will be called "qpnp-spmi". + config MFD_RDC321X tristate "RDC R-321x southbridge" select MFD_COREdrivers/mfd/Makefile +1
-0@@ -153,6 +153,7 @@ obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o obj-$(CONFIG_MFD_PM8921_CORE) += pm8921-core.o ssbi.o +obj-$(CONFIG_MFD_QPNP_SPMI) += qpnp-spmi.o obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o obj-$(CONFIG_MFD_TPS65090) += tps65090.o obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.odrivers/mfd/qpnp-spmi.c new file +0
-0
drivers/mfd/qpnp-spmi.c line 2
Quoted 2 lines
drivers/mfd/qpnp-spmi.c new file +2
-0@@ -0,0 +1,129 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. +*
Non-standard multi-line comment. First line should be blank.
drivers/mfd/qpnp-spmi.c line 5
Quoted 3 lines
drivers/mfd/qpnp-spmi.c new file +3
-0+* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 and +* only version 2 as published by the Free Software Foundation.
No author?
Quoted 89 lines
drivers/mfd/qpnp-spmi.c new file +89
-0+* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/spmi.h> +#include <linux/regmap.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/mfd/core.h> + +#define QPNP_RESOURCE_SIZE 256 + +static const struct regmap_config qpnp_regmap_config = { + .reg_bits =16 , + .val_bits =8 , + .max_register =0xffff , +}; + +static int qpnp_index_to_resource (struct device_node *np,int index, +struct resource *res) +{ +const char *name =NULL ; +const __be32 *addrp; +u64 addr; + + addrp =of_get_address (np, index,NULL ,NULL ); +if (!addrp) +return -EINVAL ; + + addr =of_read_number (addrp,1 ); +if (addr ==OF_BAD_ADDR ) +return -EINVAL ; + +of_property_read_string_index (np,"reg-names" , index, &name); + + res->start = addr; + res->end = addr +QPNP_RESOURCE_SIZE -1 ; + res->flags =IORESOURCE_REG ; + res->name = name ? name : np->name; + +return 0 ; +} + +static int qpnp_add_device (struct spmi_device *root,struct device_node *child) +{ +struct mfd_cell cell = {}; +struct resource *res, *r; +int num_resources =0 ; +const char *compat; +int ret, i; + + compat =of_get_property (child,"compatible" ,NULL ); +if (!compat) +return -ENODEV ; + +while (of_get_address (child, num_resources,NULL ,NULL )) + num_resources++; + +if (!num_resources) +return -ENODEV ; + + res =kcalloc (num_resources,sizeof (*res),GFP_KERNEL ); +if (!res) +return -ENOMEM ; + + r = res; +for (i =0 ; i < num_resources; i++, r++) +qpnp_index_to_resource (child, i, r); + + cell.name =kasprintf (GFP_KERNEL ,"%x.%04x.%s" , root->usid, + (u16 )res[0 ].start, child->name); + cell.of_compatible = compat; + cell.num_resources = num_resources; + cell.resources = res; + + ret =mfd_add_devices (&root->dev,PLATFORM_DEVID_NONE , &cell,1 , +NULL ,0 ,NULL ); + +kfree (res); +kfree (cell.name); + +return ret; +} + +static int qpnp_probe (struct spmi_device *sdev) +{
drivers/mfd/qpnp-spmi.c line 105
Quoted 10 lines
drivers/mfd/qpnp-spmi.c new file +10
-0+struct device_node *root = sdev->dev.of_node; +struct device_node *child; +struct regmap *regmap; + + regmap =devm_regmap_init_spmi_ext (sdev, &qpnp_regmap_config); +if (IS_ERR (regmap)) +return PTR_ERR (regmap); + +for_each_available_child_of_node (root, child) +qpnp_add_device (sdev, child);
This entire driver looks like a re-write of of_platform_populate().
Why?
Quoted 23 lines
drivers/mfd/qpnp-spmi.c new file +23
-0+return 0 ; +} + +static void qpnp_remove (struct spmi_device *sdev) +{ +mfd_remove_devices (&sdev->dev); +} + +static const struct of_device_id qpnp_id_table[] = { + { .compatible ="qcom,qpnp-spmi" , }, + { }, +}; +MODULE_DEVICE_TABLE (of, qpnp_id_table); + +static struct spmi_driver qpnp_driver = { + .probe = qpnp_probe, + .remove = qpnp_remove, + .driver = { + .name ="qpnp-spmi" , + .of_match_table = qpnp_id_table, + }, +}; +module_spmi_driver (qpnp_driver);
Signature · 8 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC PATCH v2 1/5] mfd: qpnp: add support for Qualcomm QPNP PMICs
Hi Lee,
Thanks for the comments.
Quoted 26 lines · Lee Jones
Quoted 25 lines · Stanimir Varbanov
From: Josh Cartwright <[email protected]>
The Qualcomm QPNP PMIC chips are components used with the Snapdragon 800 series SoC family. This driver exists largely as a glue mfd component, it exists to be an owner of an SPMI regmap for children devices described in device tree.
Signed-off-by Josh Cartwright <[email protected]>Signed-off-by Stanimir Varbanov <[email protected]>--- drivers/mfd/Kconfig | 15 ++++++ drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/qpnp-spmi.cdrivers/mfd/Kconfig +0
-0@@ -524,6 +524,21 @@ config MFD_PM8921_CORE Say M here if you want to include support for PM8921 chip as a module. This will build a module called "pm8921-core".
Quoted 14 lines
drivers/mfd/Kconfig config MFD_PM8921_CORE · line 537
Quoted 11 lines
drivers/mfd/Kconfig +11
-0+config MFD_QPNP_SPMI + tristate "Qualcomm QPNP SPMI PMIC" + depends on ARCH_QCOM || COMPILE_TEST + depends on OF + select MFD_CORE + select REGMAP_SPMI + help + This enables support for the Qualcomm QPNP SPMI PMICs. + These PMICs are currently used with the Snapdragon 800 series of + SoCs. Note, that this will only be useful paired with descriptions + of the independent functions as children nodes in the device tree.It would be helpful if the expected types of child devices were mentioned here in the help section.
They are many, but I could list the major ones.
Quoted 21 lines
Quoted 21 lines
drivers/mfd/Kconfig +3
-0+ Say M here if you want to include support for the QPNP SPMI PMIC + series as a module. The module will be called "qpnp-spmi". + config MFD_RDC321X tristate "RDC R-321x southbridge" select MFD_COREdrivers/mfd/Makefile +1
-0@@ -153,6 +153,7 @@ obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o obj-$(CONFIG_MFD_PM8921_CORE) += pm8921-core.o ssbi.o +obj-$(CONFIG_MFD_QPNP_SPMI) += qpnp-spmi.o obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o obj-$(CONFIG_MFD_TPS65090) += tps65090.o obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.odrivers/mfd/qpnp-spmi.c new file +0
-0
Quoted 8 lines
drivers/mfd/qpnp-spmi.c line 2
Quoted 6 lines
index 0000000..efd7d3e
drivers/mfd/qpnp-spmi.c new file +2
-0@@ -0,0 +1,129 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. +* Non-standard multi-line comment. First line should be blank.
sure, will fix.
Quoted 109 lines
drivers/mfd/qpnp-spmi.c line 5
Quoted 4 lines
drivers/mfd/qpnp-spmi.c new file +3
-0+* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 and +* only version 2 as published by the Free Software Foundation. No author?
Quoted 89 lines
drivers/mfd/qpnp-spmi.c new file +89
-0+* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/spmi.h> +#include <linux/regmap.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/mfd/core.h> + +#define QPNP_RESOURCE_SIZE 256 + +static const struct regmap_config qpnp_regmap_config = { + .reg_bits =16 , + .val_bits =8 , + .max_register =0xffff , +}; + +static int qpnp_index_to_resource (struct device_node *np,int index, +struct resource *res) +{ +const char *name =NULL ; +const __be32 *addrp; +u64 addr; + + addrp =of_get_address (np, index,NULL ,NULL ); +if (!addrp) +return -EINVAL ; + + addr =of_read_number (addrp,1 ); +if (addr ==OF_BAD_ADDR ) +return -EINVAL ; + +of_property_read_string_index (np,"reg-names" , index, &name); + + res->start = addr; + res->end = addr +QPNP_RESOURCE_SIZE -1 ; + res->flags =IORESOURCE_REG ; + res->name = name ? name : np->name; + +return 0 ; +} + +static int qpnp_add_device (struct spmi_device *root,struct device_node *child) +{ +struct mfd_cell cell = {}; +struct resource *res, *r; +int num_resources =0 ; +const char *compat; +int ret, i; + + compat =of_get_property (child,"compatible" ,NULL ); +if (!compat) +return -ENODEV ; + +while (of_get_address (child, num_resources,NULL ,NULL )) + num_resources++; + +if (!num_resources) +return -ENODEV ; + + res =kcalloc (num_resources,sizeof (*res),GFP_KERNEL ); +if (!res) +return -ENOMEM ; + + r = res; +for (i =0 ; i < num_resources; i++, r++) +qpnp_index_to_resource (child, i, r); + + cell.name =kasprintf (GFP_KERNEL ,"%x.%04x.%s" , root->usid, + (u16 )res[0 ].start, child->name); + cell.of_compatible = compat; + cell.num_resources = num_resources; + cell.resources = res; + + ret =mfd_add_devices (&root->dev,PLATFORM_DEVID_NONE , &cell,1 , +NULL ,0 ,NULL ); + +kfree (res); +kfree (cell.name); + +return ret; +} + +static int qpnp_probe (struct spmi_device *sdev) +{drivers/mfd/qpnp-spmi.c line 105
Quoted 10 lines
drivers/mfd/qpnp-spmi.c new file +10
-0+struct device_node *root = sdev->dev.of_node; +struct device_node *child; +struct regmap *regmap; + + regmap =devm_regmap_init_spmi_ext (sdev, &qpnp_regmap_config); +if (IS_ERR (regmap)) +return PTR_ERR (regmap); + +for_each_available_child_of_node (root, child) +qpnp_add_device (sdev, child);This entire driver looks like a re-write of
of_platform_populate().
Quoted 1 line
Why?
of_platform_populate is not used because the PMIC function resources are non-translatable. You can see that the resources are of type IORESOURCE_REG (qpnp_index_to_resource()) not IORESOURCE_MEM or _IO.
The whole point of this mfd driver is to parse devicetree to prepare resources for every child and create platform device for it through mfd_add_devices(). Then the PMIC function driver got its resources and use them as register addresses passed to regmap. These register accesses hits the SPMI controller which is the physical interface between PMIC's and SoC.
Signature · 2 lines
regards, Stan
Re: [RFC PATCH v2 1/5] mfd: qpnp: add support for Qualcomm QPNP PMICs
Quoted 195 lines · Stanimir Varbanov
Hi Lee,
Thanks for the comments.
Quoted 26 lines · Lee Jones
Quoted 25 lines · Stanimir Varbanov
From: Josh Cartwright <[email protected]>
The Qualcomm QPNP PMIC chips are components used with the Snapdragon 800 series SoC family. This driver exists largely as a glue mfd component, it exists to be an owner of an SPMI regmap for children devices described in device tree.
Signed-off-by Josh Cartwright <[email protected]>Signed-off-by Stanimir Varbanov <[email protected]>--- drivers/mfd/Kconfig | 15 ++++++ drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/qpnp-spmi.cdrivers/mfd/Kconfig +0
-0@@ -524,6 +524,21 @@ config MFD_PM8921_CORE Say M here if you want to include support for PM8921 chip as a module. This will build a module called "pm8921-core".Quoted 14 lines
drivers/mfd/Kconfig config MFD_PM8921_CORE · line 537
Quoted 11 lines
drivers/mfd/Kconfig +11
-0+config MFD_QPNP_SPMI + tristate "Qualcomm QPNP SPMI PMIC" + depends on ARCH_QCOM || COMPILE_TEST + depends on OF + select MFD_CORE + select REGMAP_SPMI + help + This enables support for the Qualcomm QPNP SPMI PMICs. + These PMICs are currently used with the Snapdragon 800 series of + SoCs. Note, that this will only be useful paired with descriptions + of the independent functions as children nodes in the device tree.It would be helpful if the expected types of child devices were mentioned here in the help section.
They are many, but I could list the major ones.
Quoted 21 lines
Quoted 21 lines
drivers/mfd/Kconfig +3
-0+ Say M here if you want to include support for the QPNP SPMI PMIC + series as a module. The module will be called "qpnp-spmi". + config MFD_RDC321X tristate "RDC R-321x southbridge" select MFD_COREdrivers/mfd/Makefile +1
-0@@ -153,6 +153,7 @@ obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o obj-$(CONFIG_MFD_PM8921_CORE) += pm8921-core.o ssbi.o +obj-$(CONFIG_MFD_QPNP_SPMI) += qpnp-spmi.o obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o obj-$(CONFIG_MFD_TPS65090) += tps65090.o obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.odrivers/mfd/qpnp-spmi.c new file +0
-0Quoted 8 lines
drivers/mfd/qpnp-spmi.c line 2
Quoted 6 lines
index 0000000..efd7d3e
drivers/mfd/qpnp-spmi.c new file +2
-0@@ -0,0 +1,129 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. +* Non-standard multi-line comment. First line should be blank.
sure, will fix.
Quoted 109 lines
drivers/mfd/qpnp-spmi.c line 5
Quoted 4 lines
drivers/mfd/qpnp-spmi.c new file +3
-0+* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 and +* only version 2 as published by the Free Software Foundation. No author?
Quoted 89 lines
drivers/mfd/qpnp-spmi.c new file +89
-0+* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/spmi.h> +#include <linux/regmap.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/mfd/core.h> + +#define QPNP_RESOURCE_SIZE 256 + +static const struct regmap_config qpnp_regmap_config = { + .reg_bits =16 , + .val_bits =8 , + .max_register =0xffff , +}; + +static int qpnp_index_to_resource (struct device_node *np,int index, +struct resource *res) +{ +const char *name =NULL ; +const __be32 *addrp; +u64 addr; + + addrp =of_get_address (np, index,NULL ,NULL ); +if (!addrp) +return -EINVAL ; + + addr =of_read_number (addrp,1 ); +if (addr ==OF_BAD_ADDR ) +return -EINVAL ; + +of_property_read_string_index (np,"reg-names" , index, &name); + + res->start = addr; + res->end = addr +QPNP_RESOURCE_SIZE -1 ; + res->flags =IORESOURCE_REG ; + res->name = name ? name : np->name; + +return 0 ; +} + +static int qpnp_add_device (struct spmi_device *root,struct device_node *child) +{ +struct mfd_cell cell = {}; +struct resource *res, *r; +int num_resources =0 ; +const char *compat; +int ret, i; + + compat =of_get_property (child,"compatible" ,NULL ); +if (!compat) +return -ENODEV ; + +while (of_get_address (child, num_resources,NULL ,NULL )) + num_resources++; + +if (!num_resources) +return -ENODEV ; + + res =kcalloc (num_resources,sizeof (*res),GFP_KERNEL ); +if (!res) +return -ENOMEM ; + + r = res; +for (i =0 ; i < num_resources; i++, r++) +qpnp_index_to_resource (child, i, r); + + cell.name =kasprintf (GFP_KERNEL ,"%x.%04x.%s" , root->usid, + (u16 )res[0 ].start, child->name); + cell.of_compatible = compat; + cell.num_resources = num_resources; + cell.resources = res; + + ret =mfd_add_devices (&root->dev,PLATFORM_DEVID_NONE , &cell,1 , +NULL ,0 ,NULL ); + +kfree (res); +kfree (cell.name); + +return ret; +} + +static int qpnp_probe (struct spmi_device *sdev) +{drivers/mfd/qpnp-spmi.c line 105
Quoted 10 lines
drivers/mfd/qpnp-spmi.c new file +10
-0+struct device_node *root = sdev->dev.of_node; +struct device_node *child; +struct regmap *regmap; + + regmap =devm_regmap_init_spmi_ext (sdev, &qpnp_regmap_config); +if (IS_ERR (regmap)) +return PTR_ERR (regmap); + +for_each_available_child_of_node (root, child) +qpnp_add_device (sdev, child);This entire driver looks like a re-write of
of_platform_populate().Quoted 1 line
Why?
of_platform_populateis not used because the PMIC function resources are non-translatable. You can see that the resources are of typeIORESOURCE_REG(qpnp_index_to_resource()) notIORESOURCE_MEMor_IO.
Quoted 6 lines
The whole point of this mfd driver is to parse devicetree to prepare resources for every child and create platform device for it through
mfd_add_devices(). Then the PMIC function driver got its resources and use them as register addresses passed to regmap. These register accesses hits the SPMI controller which is the physical interface between PMIC's and SoC.
I can't help but think that if this is required, it should be part of the core OF code, rather than doing your own thing which looks frighteningly like existing framework functionality.
Either way, I'm going to need a DT Ack before I accept this.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [RFC PATCH v2 1/5] mfd: qpnp: add support for Qualcomm QPNP PMICs
Hi,
+Rob
Rob I used your old email, sorry about that.
<snip>
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 34 lines
The Qualcomm QPNP PMIC chips are components used with the Snapdragon 800 series SoC family. This driver exists largely as a glue mfd component, it exists to be an owner of an SPMI regmap for children devices described in device tree.
Signed-off-by Josh Cartwright <[email protected]>Signed-off-by Stanimir Varbanov <[email protected]>--- drivers/mfd/Kconfig | 15 ++++++ drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/qpnp-spmi.cdrivers/mfd/Kconfig +11
-0@@ -524,6 +524,21 @@ config MFD_PM8921_CORE Say M here if you want to include support for PM8921 chip as a module. This will build a module called "pm8921-core". +config MFD_QPNP_SPMI + tristate "Qualcomm QPNP SPMI PMIC" + depends on ARCH_QCOM || COMPILE_TEST + depends on OF + select MFD_CORE + select REGMAP_SPMI + help + This enables support for the Qualcomm QPNP SPMI PMICs. + These PMICs are currently used with the Snapdragon 800 series of + SoCs. Note, that this will only be useful paired with descriptions + of the independent functions as children nodes in the device tree.
<snip>
Quoted 116 lines
Quoted 109 lines
Quoted 103 lines
Quoted 90 lines
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */drivers/mfd/Kconfig +84
-0+#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/spmi.h> +#include <linux/regmap.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/mfd/core.h> + +#define QPNP_RESOURCE_SIZE 256 + +static const struct regmap_config qpnp_regmap_config = { + .reg_bits = 16, + .val_bits = 8, + .max_register = 0xffff, +}; + +static int qpnp_index_to_resource(struct device_node *np, int index, + struct resource *res) +{ + const char *name = NULL; + const __be32 *addrp; + u64 addr; + + addrp = of_get_address(np, index, NULL, NULL); + if (!addrp) + return -EINVAL; + + addr = of_read_number(addrp, 1); + if (addr == OF_BAD_ADDR) + return -EINVAL; + + of_property_read_string_index(np, "reg-names", index, &name); + + res->start = addr; + res->end = addr + QPNP_RESOURCE_SIZE - 1; + res->flags = IORESOURCE_REG; + res->name = name ? name : np->name; + + return 0; +} + +static int qpnp_add_device(struct spmi_device *root, struct device_node *child) +{ + struct mfd_cell cell = {}; + struct resource *res, *r; + int num_resources = 0; + const char *compat; + int ret, i; + + compat = of_get_property(child, "compatible", NULL); + if (!compat) + return -ENODEV; + + while (of_get_address(child, num_resources, NULL, NULL)) + num_resources++; + + if (!num_resources) + return -ENODEV; + + res = kcalloc(num_resources, sizeof(*res), GFP_KERNEL); + if (!res) + return -ENOMEM; + + r = res; + for (i = 0; i < num_resources; i++, r++) + qpnp_index_to_resource(child, i, r); + + cell.name = kasprintf(GFP_KERNEL, "%x.%04x.%s", root->usid, + (u16)res[0].start, child->name); + cell.of_compatible = compat; + cell.num_resources = num_resources; + cell.resources = res; + + ret = mfd_add_devices(&root->dev, PLATFORM_DEVID_NONE, &cell, 1, + NULL, 0, NULL); + + kfree(res); + kfree(cell.name); + + return ret; +} + +static int qpnp_probe(struct spmi_device *sdev) +{drivers/mfd/Kconfig
Quoted 10 lines
drivers/mfd/Kconfig +10
-0+ struct device_node *root = sdev->dev.of_node; + struct device_node *child; + struct regmap *regmap; + + regmap = devm_regmap_init_spmi_ext(sdev, &qpnp_regmap_config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + for_each_available_child_of_node(root, child) + qpnp_add_device(sdev, child);This entire driver looks like a re-write of
of_platform_populate().Quoted 1 line
Why?
of_platform_populateis not used because the PMIC function resources are non-translatable. You can see that the resources are of typeIORESOURCE_REG(qpnp_index_to_resource()) notIORESOURCE_MEMor_IO.Quoted 6 lines
The whole point of this mfd driver is to parse devicetree to prepare resources for every child and create platform device for it through
mfd_add_devices(). Then the PMIC function driver got its resources and use them as register addresses passed to regmap. These register accesses hits the SPMI controller which is the physical interface between PMIC's and SoC.
Quoted 3 lines
I can't help but think that if this is required, it should be part of the core OF code, rather than doing your own thing which looks frighteningly like existing framework functionality.
Lee,
does it make sense to have a common of_mfd code for devicetree parsing? Is that discussed already? I mean presently the mfd_cell resources and number of resources are passed by the mfd_add_devices users. Is it possible to have common code which parses devicetree sub-nodes of the parent device_node and fill resources/create platform devices for them.
Rob, Grant I hope you guys have something to say here?
Quoted 3 lines
Either way, I'm going to need a DT Ack before I accept this.
Sure.
Signature · 2 lines
regards, Stan
Re: [RFC PATCH v2 1/5] mfd: qpnp: add support for Qualcomm QPNP PMICs
Quoted 158 lines · Stanimir Varbanov
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 34 lines
The Qualcomm QPNP PMIC chips are components used with the Snapdragon 800 series SoC family. This driver exists largely as a glue mfd component, it exists to be an owner of an SPMI regmap for children devices described in device tree.
Signed-off-by Josh Cartwright <[email protected]>Signed-off-by Stanimir Varbanov <[email protected]>--- drivers/mfd/Kconfig | 15 ++++++ drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/qpnp-spmi.cdrivers/mfd/Kconfig +11
-0@@ -524,6 +524,21 @@ config MFD_PM8921_CORE Say M here if you want to include support for PM8921 chip as a module. This will build a module called "pm8921-core". +config MFD_QPNP_SPMI + tristate "Qualcomm QPNP SPMI PMIC" + depends on ARCH_QCOM || COMPILE_TEST + depends on OF + select MFD_CORE + select REGMAP_SPMI + help + This enables support for the Qualcomm QPNP SPMI PMICs. + These PMICs are currently used with the Snapdragon 800 series of + SoCs. Note, that this will only be useful paired with descriptions + of the independent functions as children nodes in the device tree.<snip>
Quoted 116 lines
Quoted 109 lines
Quoted 103 lines
Quoted 90 lines
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */drivers/mfd/Kconfig +84
-0+#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/spmi.h> +#include <linux/regmap.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/mfd/core.h> + +#define QPNP_RESOURCE_SIZE 256 + +static const struct regmap_config qpnp_regmap_config = { + .reg_bits = 16, + .val_bits = 8, + .max_register = 0xffff, +}; + +static int qpnp_index_to_resource(struct device_node *np, int index, + struct resource *res) +{ + const char *name = NULL; + const __be32 *addrp; + u64 addr; + + addrp = of_get_address(np, index, NULL, NULL); + if (!addrp) + return -EINVAL; + + addr = of_read_number(addrp, 1); + if (addr == OF_BAD_ADDR) + return -EINVAL; + + of_property_read_string_index(np, "reg-names", index, &name); + + res->start = addr; + res->end = addr + QPNP_RESOURCE_SIZE - 1; + res->flags = IORESOURCE_REG; + res->name = name ? name : np->name; + + return 0; +} + +static int qpnp_add_device(struct spmi_device *root, struct device_node *child) +{ + struct mfd_cell cell = {}; + struct resource *res, *r; + int num_resources = 0; + const char *compat; + int ret, i; + + compat = of_get_property(child, "compatible", NULL); + if (!compat) + return -ENODEV; + + while (of_get_address(child, num_resources, NULL, NULL)) + num_resources++; + + if (!num_resources) + return -ENODEV; + + res = kcalloc(num_resources, sizeof(*res), GFP_KERNEL); + if (!res) + return -ENOMEM; + + r = res; + for (i = 0; i < num_resources; i++, r++) + qpnp_index_to_resource(child, i, r); + + cell.name = kasprintf(GFP_KERNEL, "%x.%04x.%s", root->usid, + (u16)res[0].start, child->name); + cell.of_compatible = compat; + cell.num_resources = num_resources; + cell.resources = res; + + ret = mfd_add_devices(&root->dev, PLATFORM_DEVID_NONE, &cell, 1, + NULL, 0, NULL); + + kfree(res); + kfree(cell.name); + + return ret; +} + +static int qpnp_probe(struct spmi_device *sdev) +{drivers/mfd/Kconfig
Quoted 10 lines
drivers/mfd/Kconfig +10
-0+ struct device_node *root = sdev->dev.of_node; + struct device_node *child; + struct regmap *regmap; + + regmap = devm_regmap_init_spmi_ext(sdev, &qpnp_regmap_config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + for_each_available_child_of_node(root, child) + qpnp_add_device(sdev, child);This entire driver looks like a re-write of
of_platform_populate().Quoted 1 line
Why?
of_platform_populateis not used because the PMIC function resources are non-translatable. You can see that the resources are of typeIORESOURCE_REG(qpnp_index_to_resource()) notIORESOURCE_MEMor_IO.Quoted 6 lines
The whole point of this mfd driver is to parse devicetree to prepare resources for every child and create platform device for it through
mfd_add_devices(). Then the PMIC function driver got its resources and use them as register addresses passed to regmap. These register accesses hits the SPMI controller which is the physical interface between PMIC's and SoC.Quoted 3 lines
I can't help but think that if this is required, it should be part of the core OF code, rather than doing your own thing which looks frighteningly like existing framework functionality.
Quoted 5 lines
does it make sense to have a common
of_mfdcode for devicetree parsing? Is that discussed already? I mean presently themfd_cellresources and number of resources are passed by themfd_add_devicesusers. Is it possible to have common code which parses devicetree sub-nodes of the parentdevice_nodeand fill resources/create platform devices for them.
I'm not sure it does. Normally users _either_ represent devices in MFD cells from within the driver _or_ populate using existing DT interfaces i.e. of_platform_populate(). This is the first time I've seen someone attempt to parse the entire MFD node structure from within a driver.
After searching for some documentation to try and figure this out, I noticed that you've also missed a patch from your set:
mfd: qpnp-spmi: document DT bindings for Qualcomm QPNP PMICs
... which might help enlighten the DT guys.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [RFC PATCH v2 1/5] mfd: qpnp: add support for Qualcomm QPNP PMICs
Hi Lee,
Quoted 165 lines · Lee Jones
Quoted 158 lines · Stanimir Varbanov
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 34 lines
The Qualcomm QPNP PMIC chips are components used with the Snapdragon 800 series SoC family. This driver exists largely as a glue mfd component, it exists to be an owner of an SPMI regmap for children devices described in device tree.
Signed-off-by Josh Cartwright <[email protected]>Signed-off-by Stanimir Varbanov <[email protected]>--- drivers/mfd/Kconfig | 15 ++++++ drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/qpnp-spmi.cdrivers/mfd/Kconfig +11
-0@@ -524,6 +524,21 @@ config MFD_PM8921_CORE Say M here if you want to include support for PM8921 chip as a module. This will build a module called "pm8921-core". +config MFD_QPNP_SPMI + tristate "Qualcomm QPNP SPMI PMIC" + depends on ARCH_QCOM || COMPILE_TEST + depends on OF + select MFD_CORE + select REGMAP_SPMI + help + This enables support for the Qualcomm QPNP SPMI PMICs. + These PMICs are currently used with the Snapdragon 800 series of + SoCs. Note, that this will only be useful paired with descriptions + of the independent functions as children nodes in the device tree.<snip>
Quoted 116 lines
Quoted 109 lines
Quoted 103 lines
Quoted 90 lines
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */drivers/mfd/Kconfig +84
-0+#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/spmi.h> +#include <linux/regmap.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/mfd/core.h> + +#define QPNP_RESOURCE_SIZE 256 + +static const struct regmap_config qpnp_regmap_config = { + .reg_bits = 16, + .val_bits = 8, + .max_register = 0xffff, +}; + +static int qpnp_index_to_resource(struct device_node *np, int index, + struct resource *res) +{ + const char *name = NULL; + const __be32 *addrp; + u64 addr; + + addrp = of_get_address(np, index, NULL, NULL); + if (!addrp) + return -EINVAL; + + addr = of_read_number(addrp, 1); + if (addr == OF_BAD_ADDR) + return -EINVAL; + + of_property_read_string_index(np, "reg-names", index, &name); + + res->start = addr; + res->end = addr + QPNP_RESOURCE_SIZE - 1; + res->flags = IORESOURCE_REG; + res->name = name ? name : np->name; + + return 0; +} + +static int qpnp_add_device(struct spmi_device *root, struct device_node *child) +{ + struct mfd_cell cell = {}; + struct resource *res, *r; + int num_resources = 0; + const char *compat; + int ret, i; + + compat = of_get_property(child, "compatible", NULL); + if (!compat) + return -ENODEV; + + while (of_get_address(child, num_resources, NULL, NULL)) + num_resources++; + + if (!num_resources) + return -ENODEV; + + res = kcalloc(num_resources, sizeof(*res), GFP_KERNEL); + if (!res) + return -ENOMEM; + + r = res; + for (i = 0; i < num_resources; i++, r++) + qpnp_index_to_resource(child, i, r); + + cell.name = kasprintf(GFP_KERNEL, "%x.%04x.%s", root->usid, + (u16)res[0].start, child->name); + cell.of_compatible = compat; + cell.num_resources = num_resources; + cell.resources = res; + + ret = mfd_add_devices(&root->dev, PLATFORM_DEVID_NONE, &cell, 1, + NULL, 0, NULL); + + kfree(res); + kfree(cell.name); + + return ret; +} + +static int qpnp_probe(struct spmi_device *sdev) +{drivers/mfd/Kconfig
Quoted 10 lines
drivers/mfd/Kconfig +10
-0+ struct device_node *root = sdev->dev.of_node; + struct device_node *child; + struct regmap *regmap; + + regmap = devm_regmap_init_spmi_ext(sdev, &qpnp_regmap_config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + for_each_available_child_of_node(root, child) + qpnp_add_device(sdev, child);This entire driver looks like a re-write of
of_platform_populate().Quoted 1 line
Why?
of_platform_populateis not used because the PMIC function resources are non-translatable. You can see that the resources are of typeIORESOURCE_REG(qpnp_index_to_resource()) notIORESOURCE_MEMor_IO.Quoted 6 lines
The whole point of this mfd driver is to parse devicetree to prepare resources for every child and create platform device for it through
mfd_add_devices(). Then the PMIC function driver got its resources and use them as register addresses passed to regmap. These register accesses hits the SPMI controller which is the physical interface between PMIC's and SoC.Quoted 3 lines
I can't help but think that if this is required, it should be part of the core OF code, rather than doing your own thing which looks frighteningly like existing framework functionality.
Quoted 5 lines
does it make sense to have a common
of_mfdcode for devicetree parsing? Is that discussed already? I mean presently themfd_cellresources and number of resources are passed by themfd_add_devicesusers. Is it possible to have common code which parses devicetree sub-nodes of the parentdevice_nodeand fill resources/create platform devices for them.
Quoted 5 lines
I'm not sure it does. Normally users _either_ represent devices in MFD cells from within the driver _or_ populate using existing DT interfaces i.e.
of_platform_populate(). This is the first time I've seen someone attempt to parse the entire MFD node structure from within a driver.
Our goal is to use common mfd driver for various Qualcomm PMIC from the same PMIC generation (codenamed QPNP). Presently we have good abstraction of the register manipulation functions through regmap-spmi layer. Using the devicetree to represent different peripherals base addresses (reg property) gives us a benefit by avoiding huge header files in linux/mfd and make flexible transition to new PMIC's which just change the base addresses but keep the IP block the same. This way we should change the devicetree binding without touch the drivers.
Quoted 5 lines
After searching for some documentation to try and figure this out, I noticed that you've also missed a patch from your set:
mfd: qpnp-spmi: document DT bindings for Qualcomm QPNP PMICs
I sent a new version without RFC tag which includes this binding document [1].
Quoted 3 lines
... which might help enlighten the DT guys.
Signature · 4 lines
regards, Stan [1] https://lkml.org/lkml/2014/7/8/428
Re: [RFC PATCH v2 1/5] mfd: qpnp: add support for Qualcomm QPNP PMICs
Quoted 172 lines · Stanimir Varbanov
Quoted 165 lines · Lee Jones
Quoted 158 lines · Stanimir Varbanov
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 34 lines
The Qualcomm QPNP PMIC chips are components used with the Snapdragon 800 series SoC family. This driver exists largely as a glue mfd component, it exists to be an owner of an SPMI regmap for children devices described in device tree.
Signed-off-by Josh Cartwright <[email protected]>Signed-off-by Stanimir Varbanov <[email protected]>--- drivers/mfd/Kconfig | 15 ++++++ drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/qpnp-spmi.cdrivers/mfd/Kconfig +11
-0@@ -524,6 +524,21 @@ config MFD_PM8921_CORE Say M here if you want to include support for PM8921 chip as a module. This will build a module called "pm8921-core". +config MFD_QPNP_SPMI + tristate "Qualcomm QPNP SPMI PMIC" + depends on ARCH_QCOM || COMPILE_TEST + depends on OF + select MFD_CORE + select REGMAP_SPMI + help + This enables support for the Qualcomm QPNP SPMI PMICs. + These PMICs are currently used with the Snapdragon 800 series of + SoCs. Note, that this will only be useful paired with descriptions + of the independent functions as children nodes in the device tree.<snip>
Quoted 116 lines
Quoted 109 lines
Quoted 103 lines
Quoted 90 lines
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */drivers/mfd/Kconfig +84
-0+#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/spmi.h> +#include <linux/regmap.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/mfd/core.h> + +#define QPNP_RESOURCE_SIZE 256 + +static const struct regmap_config qpnp_regmap_config = { + .reg_bits = 16, + .val_bits = 8, + .max_register = 0xffff, +}; + +static int qpnp_index_to_resource(struct device_node *np, int index, + struct resource *res) +{ + const char *name = NULL; + const __be32 *addrp; + u64 addr; + + addrp = of_get_address(np, index, NULL, NULL); + if (!addrp) + return -EINVAL; + + addr = of_read_number(addrp, 1); + if (addr == OF_BAD_ADDR) + return -EINVAL; + + of_property_read_string_index(np, "reg-names", index, &name); + + res->start = addr; + res->end = addr + QPNP_RESOURCE_SIZE - 1; + res->flags = IORESOURCE_REG; + res->name = name ? name : np->name; + + return 0; +} + +static int qpnp_add_device(struct spmi_device *root, struct device_node *child) +{ + struct mfd_cell cell = {}; + struct resource *res, *r; + int num_resources = 0; + const char *compat; + int ret, i; + + compat = of_get_property(child, "compatible", NULL); + if (!compat) + return -ENODEV; + + while (of_get_address(child, num_resources, NULL, NULL)) + num_resources++; + + if (!num_resources) + return -ENODEV; + + res = kcalloc(num_resources, sizeof(*res), GFP_KERNEL); + if (!res) + return -ENOMEM; + + r = res; + for (i = 0; i < num_resources; i++, r++) + qpnp_index_to_resource(child, i, r); + + cell.name = kasprintf(GFP_KERNEL, "%x.%04x.%s", root->usid, + (u16)res[0].start, child->name); + cell.of_compatible = compat; + cell.num_resources = num_resources; + cell.resources = res; + + ret = mfd_add_devices(&root->dev, PLATFORM_DEVID_NONE, &cell, 1, + NULL, 0, NULL); + + kfree(res); + kfree(cell.name); + + return ret; +} + +static int qpnp_probe(struct spmi_device *sdev) +{drivers/mfd/Kconfig
Quoted 10 lines
drivers/mfd/Kconfig +10
-0+ struct device_node *root = sdev->dev.of_node; + struct device_node *child; + struct regmap *regmap; + + regmap = devm_regmap_init_spmi_ext(sdev, &qpnp_regmap_config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + for_each_available_child_of_node(root, child) + qpnp_add_device(sdev, child);This entire driver looks like a re-write of
of_platform_populate().Quoted 1 line
Why?
of_platform_populateis not used because the PMIC function resources are non-translatable. You can see that the resources are of typeIORESOURCE_REG(qpnp_index_to_resource()) notIORESOURCE_MEMor_IO.Quoted 6 lines
The whole point of this mfd driver is to parse devicetree to prepare resources for every child and create platform device for it through
mfd_add_devices(). Then the PMIC function driver got its resources and use them as register addresses passed to regmap. These register accesses hits the SPMI controller which is the physical interface between PMIC's and SoC.Quoted 3 lines
I can't help but think that if this is required, it should be part of the core OF code, rather than doing your own thing which looks frighteningly like existing framework functionality.
Quoted 5 lines
does it make sense to have a common
of_mfdcode for devicetree parsing? Is that discussed already? I mean presently themfd_cellresources and number of resources are passed by themfd_add_devicesusers. Is it possible to have common code which parses devicetree sub-nodes of the parentdevice_nodeand fill resources/create platform devices for them.Quoted 5 lines
I'm not sure it does. Normally users _either_ represent devices in MFD cells from within the driver _or_ populate using existing DT interfaces i.e.
of_platform_populate(). This is the first time I've seen someone attempt to parse the entire MFD node structure from within a driver.
Quoted 8 lines
Our goal is to use common mfd driver for various Qualcomm PMIC from the same PMIC generation (codenamed QPNP). Presently we have good abstraction of the register manipulation functions through regmap-spmi layer. Using the devicetree to represent different peripherals base addresses (reg property) gives us a benefit by avoiding huge header files in linux/mfd and make flexible transition to new PMIC's which just change the base addresses but keep the IP block the same. This way we should change the devicetree binding without touch the drivers.
I'm still not convinced that you need to write your own parser. If you're concerned about not translating the reg property, use (or don't) the 'ranges' property accordingly.
Quoted 12 lines
Quoted 4 lines
After searching for some documentation to try and figure this out, I noticed that you've also missed a patch from your set:
mfd: qpnp-spmi: document DT bindings for Qualcomm QPNP PMICs
I sent a new version without RFC tag which includes this binding document [1].
Quoted 3 lines
... which might help enlighten the DT guys.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [RFC PATCH v2 1/5] mfd: qpnp: add support for Qualcomm QPNP PMICs
Quoted 182 lines · Lee Jones
Quoted 172 lines · Stanimir Varbanov
Quoted 165 lines · Lee Jones
Quoted 158 lines · Stanimir Varbanov
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 34 lines
The Qualcomm QPNP PMIC chips are components used with the Snapdragon 800 series SoC family. This driver exists largely as a glue mfd component, it exists to be an owner of an SPMI regmap for children devices described in device tree.
Signed-off-by Josh Cartwright <[email protected]>Signed-off-by Stanimir Varbanov <[email protected]>--- drivers/mfd/Kconfig | 15 ++++++ drivers/mfd/Makefile | 1 + drivers/mfd/qpnp-spmi.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/qpnp-spmi.cdrivers/mfd/Kconfig +11
-0@@ -524,6 +524,21 @@ config MFD_PM8921_CORE Say M here if you want to include support for PM8921 chip as a module. This will build a module called "pm8921-core". +config MFD_QPNP_SPMI + tristate "Qualcomm QPNP SPMI PMIC" + depends on ARCH_QCOM || COMPILE_TEST + depends on OF + select MFD_CORE + select REGMAP_SPMI + help + This enables support for the Qualcomm QPNP SPMI PMICs. + These PMICs are currently used with the Snapdragon 800 series of + SoCs. Note, that this will only be useful paired with descriptions + of the independent functions as children nodes in the device tree.<snip>
Quoted 116 lines
Quoted 109 lines
Quoted 103 lines
Quoted 90 lines
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */drivers/mfd/Kconfig +84
-0+#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/spmi.h> +#include <linux/regmap.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/mfd/core.h> + +#define QPNP_RESOURCE_SIZE 256 + +static const struct regmap_config qpnp_regmap_config = { + .reg_bits = 16, + .val_bits = 8, + .max_register = 0xffff, +}; + +static int qpnp_index_to_resource(struct device_node *np, int index, + struct resource *res) +{ + const char *name = NULL; + const __be32 *addrp; + u64 addr; + + addrp = of_get_address(np, index, NULL, NULL); + if (!addrp) + return -EINVAL; + + addr = of_read_number(addrp, 1); + if (addr == OF_BAD_ADDR) + return -EINVAL; + + of_property_read_string_index(np, "reg-names", index, &name); + + res->start = addr; + res->end = addr + QPNP_RESOURCE_SIZE - 1; + res->flags = IORESOURCE_REG; + res->name = name ? name : np->name; + + return 0; +} + +static int qpnp_add_device(struct spmi_device *root, struct device_node *child) +{ + struct mfd_cell cell = {}; + struct resource *res, *r; + int num_resources = 0; + const char *compat; + int ret, i; + + compat = of_get_property(child, "compatible", NULL); + if (!compat) + return -ENODEV; + + while (of_get_address(child, num_resources, NULL, NULL)) + num_resources++; + + if (!num_resources) + return -ENODEV; + + res = kcalloc(num_resources, sizeof(*res), GFP_KERNEL); + if (!res) + return -ENOMEM; + + r = res; + for (i = 0; i < num_resources; i++, r++) + qpnp_index_to_resource(child, i, r); + + cell.name = kasprintf(GFP_KERNEL, "%x.%04x.%s", root->usid, + (u16)res[0].start, child->name); + cell.of_compatible = compat; + cell.num_resources = num_resources; + cell.resources = res; + + ret = mfd_add_devices(&root->dev, PLATFORM_DEVID_NONE, &cell, 1, + NULL, 0, NULL); + + kfree(res); + kfree(cell.name); + + return ret; +} + +static int qpnp_probe(struct spmi_device *sdev) +{drivers/mfd/Kconfig
Quoted 10 lines
drivers/mfd/Kconfig +10
-0+ struct device_node *root = sdev->dev.of_node; + struct device_node *child; + struct regmap *regmap; + + regmap = devm_regmap_init_spmi_ext(sdev, &qpnp_regmap_config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + for_each_available_child_of_node(root, child) + qpnp_add_device(sdev, child);This entire driver looks like a re-write of
of_platform_populate().Quoted 1 line
Why?
of_platform_populateis not used because the PMIC function resources are non-translatable. You can see that the resources are of typeIORESOURCE_REG(qpnp_index_to_resource()) notIORESOURCE_MEMor_IO.Quoted 6 lines
The whole point of this mfd driver is to parse devicetree to prepare resources for every child and create platform device for it through
mfd_add_devices(). Then the PMIC function driver got its resources and use them as register addresses passed to regmap. These register accesses hits the SPMI controller which is the physical interface between PMIC's and SoC.Quoted 3 lines
I can't help but think that if this is required, it should be part of the core OF code, rather than doing your own thing which looks frighteningly like existing framework functionality.
Quoted 5 lines
does it make sense to have a common
of_mfdcode for devicetree parsing? Is that discussed already? I mean presently themfd_cellresources and number of resources are passed by themfd_add_devicesusers. Is it possible to have common code which parses devicetree sub-nodes of the parentdevice_nodeand fill resources/create platform devices for them.Quoted 5 lines
I'm not sure it does. Normally users _either_ represent devices in MFD cells from within the driver _or_ populate using existing DT interfaces i.e.
of_platform_populate(). This is the first time I've seen someone attempt to parse the entire MFD node structure from within a driver.Quoted 8 lines
Our goal is to use common mfd driver for various Qualcomm PMIC from the same PMIC generation (codenamed QPNP). Presently we have good abstraction of the register manipulation functions through regmap-spmi layer. Using the devicetree to represent different peripherals base addresses (reg property) gives us a benefit by avoiding huge header files in linux/mfd and make flexible transition to new PMIC's which just change the base addresses but keep the IP block the same. This way we should change the devicetree binding without touch the drivers.
Quoted 3 lines
I'm still not convinced that you need to write your own parser. If you're concerned about not translating the reg property, use (or don't) the 'ranges' property accordingly.
Unfortunately "ranges" property doesn't help here. The pmic addresses parsed from "reg" properties are SPMI addresses (similar to I2C addresses).
Signature · 2 lines
regards, Stan
RFC PATCH v2 2/5 dt: qcom: msm8974: add qpnp-spmi device nodes
In reply to Stanimir VarbanovFrom: Ivan T. Ivanov <[email protected]>
The qpnp-spmi device nodes are childrens of spmi pmic arbiter. msm8974 SoC using two pmic chips pm8941 and pm8841. Every chip has two spmi-qpnp bus id's.
--- arch/arm/boot/dts/qcom-msm8974.dtsi | 45 +++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-)
arch/arm/boot/dts/qcom-msm8974.dtsi +45 -0
@@ -3,6 +3,7 @@ #include "skeleton.dtsi" #include <dt-bindings/clock/qcom,gcc-msm8974.h> +#include <dt-bindings/spmi/spmi.h> / { model = "Qualcomm MSM8974";
@@ -236,5 +237,49 @@ #interrupt-cells = <2>; interrupts = <0 208 0>; }; + + spmi@fc4cf000 { + compatible = "qcom,spmi-pmic-arb"; + reg-names = "core", "intr", "cnfg"; + reg = <0xfc4cf000 0x1000>, + <0xfc4cb000 0x1000>, + <0xfc4ca000 0x1000>; + interrupt-names = "periph_irq"; + interrupts = <0 190 0>; + qcom,ee = <0>; + qcom,channel = <0>; + #address-cells = <2>; + #size-cells = <0>; + interrupt-controller; + #interrupt-cells = <4>; + + usid0: pm8941@0 { + compatible = "qcom,qpnp-spmi"; + reg = <0x0 SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + }; + + usid1: pm8941@1 { + compatible = "qcom,qpnp-spmi"; + reg = <0x1 SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + }; + + usid4: pm8841@4 { + compatible = "qcom,qpnp-spmi"; + reg = <0x4 SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + }; + + usid5: pm8841@5 { + compatible = "qcom,qpnp-spmi"; + reg = <0x5 SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; }; };
Signature · 6 lines
1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC PATCH v2 2/5] dt: qcom: msm8974: add qpnp-spmi device nodes
Quoted 10 lines · Stanimir Varbanov
From: Ivan T. Ivanov <[email protected]>
The qpnp-spmi device nodes are childrens of spmi pmic arbiter. msm8974 SoC using two pmic chips pm8941 and pm8841. Every chip has two spmi-qpnp bus id's.
Signed-off-by Stanimir Varbanov <[email protected]>--- arch/arm/boot/dts/qcom-msm8974.dtsi | 45 +++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-)
Subject should start with 'ARM: ' for all of your arch/arm patches.
Rest of the patch unreviewed by me.
Signature · 8 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC PATCH v2 2/5] dt: qcom: msm8974: add qpnp-spmi device nodes
Quoted 8 lines · Lee Jones
Quoted 6 lines · Stanimir Varbanov
From: Ivan T. Ivanov <[email protected]>
The qpnp-spmi device nodes are childrens of spmi pmic arbiter. msm8974 SoC using two pmic chips pm8941 and pm8841. Every chip has two spmi-qpnp bus id's.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Stanimir Varbanov <[email protected]>--- arch/arm/boot/dts/qcom-msm8974.dtsi | 45 +++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-)Subject should start with 'ARM: ' for all of your
arch/armpatches.
Sure, will correct the subject, thanks.
Signature · 2 lines
regards, Stan
RFC PATCH v2 3/5 rtc: add qpnp rtc driver
In reply to Stanimir VarbanovA 32bits RTC is housed inside PMIC. The RTC driver uses QPNP SPMI interface to communicate with the PMIC RTC module.
The RTC device is divided into two sub-peripherals:
- RTC read-write peripheral having basic RTC registers
- alarm peripheral for controlling alarm
These two RTC peripherals are childrens of QPNP SPMI bus. They use regmap to read/write to its registers into PMIC.
--- drivers/rtc/Kconfig | 8 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-qpnp.c | 489 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 498 insertions(+), 0 deletions(-) create mode 100644 drivers/rtc/rtc-qpnp.c
drivers/rtc/Kconfig +8 -0
@@ -1365,6 +1365,14 @@ config RTC_DRV_XGENE This driver can also be built as a module, if so, the module will be called "rtc-xgene". +config RTC_DRV_QPNP + tristate "Qualcomm QPNP PMIC RTC" + depends on MFD_QPNP_SPMI + help + Say Y here if you want to support the Qualcomm QPNP PMIC RTC. + To compile this driver as a module, choose M here: the + module will be called rtc-qpnp. + comment "HID Sensor RTC drivers" config RTC_DRV_HID_SENSOR_TIME
drivers/rtc/Makefile +1 -0
@@ -141,3 +141,4 @@ obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o obj-$(CONFIG_RTC_DRV_XGENE) += rtc-xgene.o obj-$(CONFIG_RTC_DRV_SIRFSOC) += rtc-sirfsoc.o obj-$(CONFIG_RTC_DRV_MOXART) += rtc-moxart.o +obj-$(CONFIG_RTC_DRV_QPNP) += rtc-qpnp.o
drivers/rtc/rtc-qpnp.c new file +489 -0
489 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Re: [RFC PATCH v2 3/5] rtc: add qpnp rtc driver
Quoted 10 lines · Stanimir Varbanov
A 32bits RTC is housed inside PMIC. The RTC driver uses QPNP SPMI interface to communicate with the PMIC RTC module.
The RTC device is divided into two sub-peripherals:
- RTC read-write peripheral having basic RTC registers
- alarm peripheral for controlling alarmThese two RTC peripherals are childrens of QPNP SPMI bus. They use regmap to read/write to its registers into PMIC.
What happened to using Josh's patch for rtc-pm8xxx.c[1]? That seems easier than adding an entire new driver for almost the same hardware.
[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-October/207665.html
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Re: [RFC PATCH v2 3/5] rtc: add qpnp rtc driver
Hi Stephen,
Quoted 8 lines · Stephen Boyd
Quoted 7 lines · Stanimir Varbanov
A 32bits RTC is housed inside PMIC. The RTC driver uses QPNP SPMI interface to communicate with the PMIC RTC module.
The RTC device is divided into two sub-peripherals:
- RTC read-write peripheral having basic RTC registers
- alarm peripheral for controlling alarm
Quoted 7 lines
Quoted 3 lines
These two RTC peripherals are childrens of QPNP SPMI bus. They use regmap to read/write to its registers into PMIC.
What happened to using Josh's patch for rtc-pm8xxx.c[1]? That seems easier than adding an entire new driver for almost the same hardware.
Ups, I completely forgot about Josh's patch, thanks for the reminder. Nevermind, the intention of the patch set was to get agreement on the approach of the qpnp-spmi driver. The rtc is just slightly reworked to platform driver downstream rtc driver. And last but not least I've used rtc to test the approach and as a example of PMIC function/peripheral driver.
I will see what efforts are needed to reuse rtc-pm8xxx.
Signature · 2 lines
regards, Stan
Re: [RFC PATCH v2 3/5] rtc: add qpnp rtc driver
In reply to Stanimir VarbanovOn Thu, Jul 3, 2014 at 6:14 AM, Stanimir Varbanov <[email protected]> wrote:
[...]
drivers/rtc/rtc-qpnp.c line 473
Quoted 5 lines
drivers/rtc/rtc-qpnp.c new file +5
-0+static const struct of_device_id qpnp_rtc_table[] = { + { .compatible ="qcom,qpnp-rtc" , }, + {} +}; +MODULE_DEVICE_TABLE (of, rtc_qpnp_table);
We have had a lot of discussions related to how to name pm8x41 drivers; as they obviously fall under pm8xxx in most peoples eyes.
As you guys have explained, QPNP is defining the split of address space and how interrupts are layed out. To me this does however not say anything related to the actual functionality; e.g. the rtc in this case.
Are you by this patch saying that this is the one and only rtc hardware that will ever be spun under the QPNP umbrella? I would expect the naming to be more specific; and definitely the compatible to be specific.
This concern goes for all the qpnp drivers.
Regards,
Bjorn
Re: [RFC PATCH v2 3/5] rtc: add qpnp rtc driver
Quoted 10 lines · Bjorn Andersson
On Thu, Jul 3, 2014 at 6:14 AM, Stanimir Varbanov <[email protected]> wrote:
[...]drivers/rtc/rtc-qpnp.c line 473
Quoted 5 lines
drivers/rtc/rtc-qpnp.c new file +5
-0+static const struct of_device_id qpnp_rtc_table[] = { + { .compatible ="qcom,qpnp-rtc" , }, + {} +}; +MODULE_DEVICE_TABLE (of, rtc_qpnp_table);We have had a lot of discussions related to how to name pm8x41 drivers; as they obviously fall under pm8xxx in most peoples eyes.
IMO the pm8xxx is misleading already.
Quoted 6 lines
As you guys have explained, QPNP is defining the split of address space and how interrupts are layed out. To me this does however not say anything related to the actual functionality; e.g. the rtc in this case.
Quoted 6 lines
Are you by this patch saying that this is the one and only rtc hardware that will ever be spun under the QPNP umbrella? I would expect the naming to be more specific; and definitely the compatible to be specific.
This concern goes for all the qpnp drivers.
QPNP "umbrella" includes 11 PMIC chips according to downstream kernel at [1]. I think that every driver with qpnp in the name will support the appropriate sub-function IP on every pmic of that list.
Of course the naming convention can be changed and for rtc we could say rtc-pm8941 in compatible string.
compatible = "qcom,pm8941-rtc", "qcom,pma8084-rtc", "qcom,qpnp-rtc";
I haven't strong opinion on the naming.
Otherwise, I will do evaluate how difficult will be to merge "rtc-qpnp" and rtc-pm8xxx. Those rtc peripherals looks similar.
Signature · 5 lines
regards, Stan [1] https://www.codeaurora.org/cgit/quic/la/kernel/msm-3.10/tree/drivers/platform/msm/qpnp-revid.c?h=msm-3.10#n27
Re: [RFC PATCH v2 3/5] rtc: add qpnp rtc driver
Hi Bjorn,
Quoted 12 lines · Stanimir Varbanov
Quoted 10 lines · Bjorn Andersson
On Thu, Jul 3, 2014 at 6:14 AM, Stanimir Varbanov <[email protected]> wrote:
[...]drivers/rtc/rtc-qpnp.c line 473
Quoted 5 lines
drivers/rtc/rtc-qpnp.c new file +5
-0+static const struct of_device_id qpnp_rtc_table[] = { + { .compatible ="qcom,qpnp-rtc" , }, + {} +}; +MODULE_DEVICE_TABLE (of, rtc_qpnp_table);We have had a lot of discussions related to how to name pm8x41 drivers; as they obviously fall under pm8xxx in most peoples eyes.
Quoted 1 line
IMO the pm8xxx is misleading already.
I guess we can rename pm8921-core.c to pm8921-ssbi.c. And then "QPNP" variant can become pm8xxx-spmi.c. This way the name reflects the physical interface used for particular pmic. We need to drop out the "xx41" because this driver will support PMA8084 as well.
Then we can try to extend the pm8xxx subsystem drivers (pmic8xxx-keypad, rtc-pm8xxx, pm8xxx-vibrator, pmic8xxx-pwrkey) to support pm8xxx-spmi (qpnp) depending on compatible string.
Signature · 2 lines
regards, Stan
RFC PATCH v2 4/5 dt: msm8974: add qpnp rtc device node
In reply to Stanimir VarbanovAdd QPNP RTC device tree node. The RTC device resides into pm8941 and is attached on usid0.
--- arch/arm/boot/dts/qcom-msm8974.dtsi | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/boot/dts/qcom-msm8974.dtsi +8 -0
@@ -3,6 +3,7 @@ #include "skeleton.dtsi" #include <dt-bindings/clock/qcom,gcc-msm8974.h> +#include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/spmi/spmi.h> / {
@@ -258,6 +259,13 @@ reg = <0x0 SPMI_USID>; #address-cells = <1>; #size-cells = <0>; + + pm8941_rtc@6000 { + compatible = "qcom,qpnp-rtc"; + reg = <0x6000 0x6100>; + reg-names = "rtc", "alarm"; + interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>; + }; }; usid1: pm8941@1 {
Signature · 1 line
1.7.0.4
RFC PATCH v2 5/5 dt: rtc: add binding document for qpnp rtc
In reply to Stanimir VarbanovAdd devicetree binding document which describes the qpnp-rtc.
--- .../devicetree/bindings/rtc/qcom,rtc-qpnp.txt | 24 ++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/rtc/qcom,rtc-qpnp.txt
Documentation/devicetree/bindings/rtc/qcom,rtc-qpnp.txt new file +24 -0
@@ -0,0 +1,24 @@ +Qualcomm RTC QPNP + +The RTC device supports 32bit RTC module housed inside QPNP PMIC's. +The driver utilizes SPMI interface to communicate with the RTC module. +RTC device is divided into two sub-peripherals one which controls +basic RTC and other for controlling alarm. + +Required properties : + - compatible: Should be "qcom,qpnp-rtc". + - reg: Specify the peripheral id for device. Currently there + are two sub-peripherals - rtc base and alarm base. + - reg-names: Specify the reg property as strings. Should be "rtc" + and "alarm", defining the rtc and alarm bases. + - interrupts: Specifies alarm interrupt, only for alarm sub-peripheral. + For more info about interrupt cells see + Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt + +Example: + rtc@6000 { + compatible = "qcom,qpnp-rtc"; + reg = <0x6000 0x6100>; + reg-names = "rtc", "alarm"; + interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>; + };
Signature · 1 line
1.7.0.4