From: peter@korsgaard.com (Peter Korsgaard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC MFD driver
Date: Thu, 14 Jan 2016 14:35:26 +0100 [thread overview]
Message-ID: <87pox41dy9.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <1452747845-2962-2-git-send-email-wenyou.yang@atmel.com> (Wenyou Yang's message of "Thu, 14 Jan 2016 13:04:04 +0800")
>>>>> "Wenyou" == Wenyou Yang <wenyou.yang@atmel.com> writes:
> This patch adds support for the Active-semi ACT8945A PMIC.
> It is a Multi Function Device with the following subdevices:
> - Regulator
> - Charger
> It is interfaced to the host controller using I2C interface,
> ACT8945A is a child device of the I2C.
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
> Changes in v5:
> - change depends on to 'I2C=y'.
Why not make it a tristate instead? Having regulators as modules is
perhaps not a very wise thing to do, but conceptually I don't see why
this code couldn't be a module.
> +config MFD_ACT8945A
> + bool "Active-semi ACT8945A"
> + select MFD_CORE
> + select REGMAP_I2C
> + depends on I2C=y && OF
> + help
> + Support for the ACT8945A PMIC from Active-semi. This device
> + features three step-down DC/DC converters and four low-dropout
> + linear regulators, along with a complete ActivePath battery
> + charger.
> +
[snip]
> +++ b/drivers/mfd/act8945a.c
> @@ -0,0 +1,109 @@
> +/*
> + * MFD driver for Active-semi ACT8945a PMIC
> + *
> + * Copyright (C) 2015 Atmel Corporation.
> + *
> + * Author: Wenyou Yang <wenyou.yang@atmel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License, or (at your
> + * option) any later version.
> + */
> +
> +#include <linux/i2c.h>
> +#include <linux/mfd/act8945a.h>
> +#include <linux/mfd/core.h>
> +#include <linux/module.h>
> +#include <linux/of_device.h>
> +#include <linux/regmap.h>
> +
> +static const struct mfd_cell act8945a_devs[] = {
> + {
> + .name = "act8945a-pmic",
> + .of_compatible = "active-semi,act8945a-regulator",
> + },
> + {
> + .name = "act8945a-charger",
> + .of_compatible = "active-semi,act8945a-charger",
> + },
> +};
> +
> +static const struct regmap_config act8945a_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> +};
> +
> +static int act8945a_i2c_probe(struct i2c_client *i2c,
> + const struct i2c_device_id *id)
> +{
> + struct act8945a_dev *act8945a;
> + int ret;
> +
> + act8945a = devm_kzalloc(&i2c->dev, sizeof(*act8945a), GFP_KERNEL);
> + if (!act8945a)
> + return -ENOMEM;
> +
What is the point of this structure (and the header file)? Can't the
subdevices just do dev_get_regmap(dev->parent)? regulator_register()
afaik already does this by default.
--
Bye, Peter Korsgaard
WARNING: multiple messages have this Message-ID (diff)
From: Peter Korsgaard <peter-+2lRwdCCLRT2eFz/2MeuCQ@public.gmane.org>
To: Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Cc: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Ian Campbell
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Krzysztof Kozlowski
<k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Nicolas Ferre
<nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Javier Martinez Canillas
<javier-0uQlZySMnqxg9hUCZPvPmw@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v5 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC MFD driver
Date: Thu, 14 Jan 2016 14:35:26 +0100 [thread overview]
Message-ID: <87pox41dy9.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <1452747845-2962-2-git-send-email-wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org> (Wenyou Yang's message of "Thu, 14 Jan 2016 13:04:04 +0800")
>>>>> "Wenyou" == Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org> writes:
> This patch adds support for the Active-semi ACT8945A PMIC.
> It is a Multi Function Device with the following subdevices:
> - Regulator
> - Charger
> It is interfaced to the host controller using I2C interface,
> ACT8945A is a child device of the I2C.
> Signed-off-by: Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
> Changes in v5:
> - change depends on to 'I2C=y'.
Why not make it a tristate instead? Having regulators as modules is
perhaps not a very wise thing to do, but conceptually I don't see why
this code couldn't be a module.
> +config MFD_ACT8945A
> + bool "Active-semi ACT8945A"
> + select MFD_CORE
> + select REGMAP_I2C
> + depends on I2C=y && OF
> + help
> + Support for the ACT8945A PMIC from Active-semi. This device
> + features three step-down DC/DC converters and four low-dropout
> + linear regulators, along with a complete ActivePath battery
> + charger.
> +
[snip]
> +++ b/drivers/mfd/act8945a.c
> @@ -0,0 +1,109 @@
> +/*
> + * MFD driver for Active-semi ACT8945a PMIC
> + *
> + * Copyright (C) 2015 Atmel Corporation.
> + *
> + * Author: Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License, or (at your
> + * option) any later version.
> + */
> +
> +#include <linux/i2c.h>
> +#include <linux/mfd/act8945a.h>
> +#include <linux/mfd/core.h>
> +#include <linux/module.h>
> +#include <linux/of_device.h>
> +#include <linux/regmap.h>
> +
> +static const struct mfd_cell act8945a_devs[] = {
> + {
> + .name = "act8945a-pmic",
> + .of_compatible = "active-semi,act8945a-regulator",
> + },
> + {
> + .name = "act8945a-charger",
> + .of_compatible = "active-semi,act8945a-charger",
> + },
> +};
> +
> +static const struct regmap_config act8945a_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> +};
> +
> +static int act8945a_i2c_probe(struct i2c_client *i2c,
> + const struct i2c_device_id *id)
> +{
> + struct act8945a_dev *act8945a;
> + int ret;
> +
> + act8945a = devm_kzalloc(&i2c->dev, sizeof(*act8945a), GFP_KERNEL);
> + if (!act8945a)
> + return -ENOMEM;
> +
What is the point of this structure (and the header file)? Can't the
subdevices just do dev_get_regmap(dev->parent)? regulator_register()
afaik already does this by default.
--
Bye, Peter Korsgaard
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Peter Korsgaard <peter@korsgaard.com>
To: Wenyou Yang <wenyou.yang@atmel.com>
Cc: Lee Jones <lee.jones@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
"Pawel Moll" <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
devicetree@vger.kernel.org,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
linux-kernel@vger.kernel.org,
Javier Martinez Canillas <javier@dowhile0.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC MFD driver
Date: Thu, 14 Jan 2016 14:35:26 +0100 [thread overview]
Message-ID: <87pox41dy9.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <1452747845-2962-2-git-send-email-wenyou.yang@atmel.com> (Wenyou Yang's message of "Thu, 14 Jan 2016 13:04:04 +0800")
>>>>> "Wenyou" == Wenyou Yang <wenyou.yang@atmel.com> writes:
> This patch adds support for the Active-semi ACT8945A PMIC.
> It is a Multi Function Device with the following subdevices:
> - Regulator
> - Charger
> It is interfaced to the host controller using I2C interface,
> ACT8945A is a child device of the I2C.
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
> Changes in v5:
> - change depends on to 'I2C=y'.
Why not make it a tristate instead? Having regulators as modules is
perhaps not a very wise thing to do, but conceptually I don't see why
this code couldn't be a module.
> +config MFD_ACT8945A
> + bool "Active-semi ACT8945A"
> + select MFD_CORE
> + select REGMAP_I2C
> + depends on I2C=y && OF
> + help
> + Support for the ACT8945A PMIC from Active-semi. This device
> + features three step-down DC/DC converters and four low-dropout
> + linear regulators, along with a complete ActivePath battery
> + charger.
> +
[snip]
> +++ b/drivers/mfd/act8945a.c
> @@ -0,0 +1,109 @@
> +/*
> + * MFD driver for Active-semi ACT8945a PMIC
> + *
> + * Copyright (C) 2015 Atmel Corporation.
> + *
> + * Author: Wenyou Yang <wenyou.yang@atmel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License, or (at your
> + * option) any later version.
> + */
> +
> +#include <linux/i2c.h>
> +#include <linux/mfd/act8945a.h>
> +#include <linux/mfd/core.h>
> +#include <linux/module.h>
> +#include <linux/of_device.h>
> +#include <linux/regmap.h>
> +
> +static const struct mfd_cell act8945a_devs[] = {
> + {
> + .name = "act8945a-pmic",
> + .of_compatible = "active-semi,act8945a-regulator",
> + },
> + {
> + .name = "act8945a-charger",
> + .of_compatible = "active-semi,act8945a-charger",
> + },
> +};
> +
> +static const struct regmap_config act8945a_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> +};
> +
> +static int act8945a_i2c_probe(struct i2c_client *i2c,
> + const struct i2c_device_id *id)
> +{
> + struct act8945a_dev *act8945a;
> + int ret;
> +
> + act8945a = devm_kzalloc(&i2c->dev, sizeof(*act8945a), GFP_KERNEL);
> + if (!act8945a)
> + return -ENOMEM;
> +
What is the point of this structure (and the header file)? Can't the
subdevices just do dev_get_regmap(dev->parent)? regulator_register()
afaik already does this by default.
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2016-01-14 13:35 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-14 5:04 [PATCH v5 0/2] mfd: act8945a: add Active-semi ACT8945A PMIC MFD driver Wenyou Yang
2016-01-14 5:04 ` Wenyou Yang
2016-01-14 5:04 ` Wenyou Yang
2016-01-14 5:04 ` [PATCH v5 1/2] " Wenyou Yang
2016-01-14 5:04 ` Wenyou Yang
2016-01-14 5:04 ` Wenyou Yang
2016-01-14 13:35 ` Peter Korsgaard [this message]
2016-01-14 13:35 ` Peter Korsgaard
2016-01-14 13:35 ` Peter Korsgaard
2016-01-15 1:16 ` Yang, Wenyou
2016-01-15 1:16 ` Yang, Wenyou
2016-01-15 1:16 ` Yang, Wenyou
2016-01-15 7:58 ` Peter Korsgaard
2016-01-15 7:58 ` Peter Korsgaard
2016-01-15 7:58 ` Peter Korsgaard
2016-01-15 8:38 ` Yang, Wenyou
2016-01-15 8:38 ` Yang, Wenyou
2016-01-15 8:38 ` Yang, Wenyou
2016-01-20 7:26 ` Yang, Wenyou
2016-01-20 7:26 ` Yang, Wenyou
2016-01-20 7:26 ` Yang, Wenyou
2016-01-20 7:40 ` Peter Korsgaard
2016-01-20 7:40 ` Peter Korsgaard
2016-01-20 7:40 ` Peter Korsgaard
2016-01-20 7:50 ` Yang, Wenyou
2016-01-20 7:50 ` Yang, Wenyou
2016-01-20 7:50 ` Yang, Wenyou
2016-01-20 7:53 ` Krzysztof Kozlowski
2016-01-20 7:53 ` Krzysztof Kozlowski
2016-01-20 7:53 ` Krzysztof Kozlowski
2016-01-14 5:04 ` [PATCH v5 2/2] mfd: add documentation for ACT8945A DT bindings Wenyou Yang
2016-01-14 5:04 ` Wenyou Yang
2016-01-14 5:04 ` Wenyou Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pox41dy9.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.