diff mbox

[U-Boot,02/12] dm: pmic: max77686: update driver code

Message ID 1431102040-745-3-git-send-email-p.marczak@samsung.com
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Przemyslaw Marczak May 8, 2015, 4:20 p.m. UTC
This update includes:
- add implementation of pmic_reg_count() method
- pmic_bind_children() - update function call name
- Kconfig: add new line at the end of file

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
---
 drivers/power/pmic/Kconfig    |  2 +-
 drivers/power/pmic/max77686.c | 15 ++++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

Comments

Simon Glass May 10, 2015, 1:56 p.m. UTC | #1
On 8 May 2015 at 10:20, Przemyslaw Marczak <p.marczak@samsung.com> wrote:
> This update includes:
> - add implementation of pmic_reg_count() method
> - pmic_bind_children() - update function call name
> - Kconfig: add new line at the end of file
>
> Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
> ---
>  drivers/power/pmic/Kconfig    |  2 +-
>  drivers/power/pmic/max77686.c | 15 ++++++++++-----
>  2 files changed, 11 insertions(+), 6 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
index af68783..d99d9e3 100644
--- a/drivers/power/pmic/Kconfig
+++ b/drivers/power/pmic/Kconfig
@@ -15,4 +15,4 @@  config DM_PMIC_MAX77686
 	depends on DM_PMIC
 	---help---
 	This config enables implementation of driver-model pmic uclass features
-	for PMIC MAX77686. The driver implements read/write operations.
\ No newline at end of file
+	for PMIC MAX77686. The driver implements read/write operations.
diff --git a/drivers/power/pmic/max77686.c b/drivers/power/pmic/max77686.c
index e9503e2..3523b4a 100644
--- a/drivers/power/pmic/max77686.c
+++ b/drivers/power/pmic/max77686.c
@@ -16,12 +16,17 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static const struct pmic_child_info pmic_childs_info[] = {
+static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "ldo", .driver = MAX77686_LDO_DRIVER },
 	{ .prefix = "buck", .driver = MAX77686_BUCK_DRIVER },
 	{ },
 };
 
+static int max77686_reg_count(struct udevice *dev)
+{
+	return MAX77686_NUM_OF_REGS;
+}
+
 static int max77686_write(struct udevice *dev, uint reg, const uint8_t *buff,
 			  int len)
 {
@@ -47,7 +52,7 @@  static int max77686_bind(struct udevice *dev)
 {
 	int regulators_node;
 	const void *blob = gd->fdt_blob;
-	int childs;
+	int children;
 
 	regulators_node = fdt_subnode_offset(blob, dev->of_offset,
 					     "voltage-regulators");
@@ -59,8 +64,8 @@  static int max77686_bind(struct udevice *dev)
 
 	debug("%s: '%s' - found regulators subnode\n", __func__, dev->name);
 
-	childs = pmic_bind_childs(dev, regulators_node, pmic_childs_info);
-	if (!childs)
+	children = pmic_bind_children(dev, regulators_node, pmic_children_info);
+	if (!children)
 		debug("%s: %s - no child found\n", __func__, dev->name);
 
 	/* Always return success for this device */
@@ -68,7 +73,7 @@  static int max77686_bind(struct udevice *dev)
 }
 
 static struct dm_pmic_ops max77686_ops = {
-	.reg_count = MAX77686_NUM_OF_REGS,
+	.reg_count = max77686_reg_count,
 	.read = max77686_read,
 	.write = max77686_write,
 };