From: Laxman Dewangan <ldewangan@nvidia.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
linus.walleij@linaro.org, gnurou@gmail.com, lee.jones@linaro.org,
broonie@kernel.org, a.zummo@towertech.it,
alexandre.belloni@free-electrons.com
Cc: lgirdwood@gmail.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
rtc-linux@googlegroups.com, swarren@nvidia.com,
treding@nvidia.com
Subject: Re: [PATCH V2 5/6] rtc: max77xxx: add RTC driver for Maxim MAX77xxx series RTC IP
Date: Thu, 14 Jan 2016 17:20:57 +0530 [thread overview]
Message-ID: <56978BA1.9050409@nvidia.com> (raw)
In-Reply-To: <5696F7F8.108@samsung.com>
On Thursday 14 January 2016 06:50 AM, Krzysztof Kozlowski wrote:
> On 14.01.2016 09:50, Krzysztof Kozlowski wrote:
>> On 13.01.2016 23:59, Laxman Dewangan wrote:
>>> On Wednesday 13 January 2016 09:55 AM, Laxman Dewangan wrote:
>>>> On Wednesday 13 January 2016 09:58 AM, Krzysztof Kozlowski wrote:
>>>>> On 13.01.2016 13:07, Laxman Dewangan wrote:
>>>>>> On Wednesday 13 January 2016 05:36 AM, Krzysztof Kozlowski wrote:
>>>>>> That is also fine to me but still I am not comfortable with the config
>>>>>> name and driver file name as this does not suggest the common.
>>>>> The name does not matter. Really. We have a lot of drivers with a
>>>>> specific device-like name and supporting different devices. To point
>>>>> that your argument is invalid - your initial name of driver
>>>>> "rtc-max77620.c" supported totally different "names": the max77620 and
>>>>> max20024. It also wasn't suggesting something "common"...
>>>> In all config string, I have mentioned the MAX20024.
>>>>
>>>>
>>>>> With my approach we are not developing common think neither. We just
>>>>> want to extend/re-use existing max77686 (or max77802) driver for new
>>>>> devices. Just like everywhere else.
>>>> OK, fine to me if this is acceptable.
>>>> I will drop this rtc patch form this series and work in max77686
>>>> driver to modify first and once merged, use this config on my defconfig.
>>>>
>>> Here, MAX686 RTC driver needs two regmap handle, one for the rtc_regmap
>>> and other for STATUS2 register access.
>>>
>>> ret = regmap_read(info->max77686->regmap, MAX77686_REG_STATUS2,
>>> &val);
>>> if (ret < 0) {
>>> dev_err(info->dev, "%s:%d fail to read status2 reg(%d)\n",
>>> __func__, __LINE__, ret);
>>> goto out;
>>> }
>>>
>>>
>>> We can not have two regmap handle on rtc driver as both regmap (pmic and
>>> rtc) registered with different i2c device.
>>>
>>> Also this register should not be accessed by RTC driver if we want to
>>> decouple as this is very much MAX77686 register set.
>>> Do we need this code?
>>> static int max77686_rtc_read_alarm(struct device *dev, struct rtc_wkalrm
>>> *alrm)
>>> {
>>> struct max77686_rtc_info *info = dev_get_drvdata(dev);
>>> u8 data[RTC_NR_TIME];
>>> unsigned int val;
>>> int i, ret;
>>>
>>> ::::::::
>>> alrm->pending = 0;
>>> ret = regmap_read(info->max77686->regmap, MAX77686_REG_STATUS2,
>>> &val);
>>> if (ret < 0) {
>>> dev_err(info->dev, "%s:%d fail to read status2 reg(%d)\n",
>>> __func__, __LINE__, ret);
>>> goto out;
>>> }
>>>
>>> if (val & (1 << 4)) /* RTCA1 */
>>> alrm->pending = 1;
>>>
>>> }
>> Most of the drivers set the 'pending' field when reading alarm. Your
>> original driver did not.
>>
>> The max77802 does exactly the same (BTW, these should be merged as
>> well... I'll add this to the TODO list) so I think this is necessary.
> How about merging max77802 to max77686 first? The only differences I
> found are:
> 1. It uses main MFD/PMIC regmap.
> This can be solved as part of decoupling code. The driver will get
> MFD's regmap and set up its own (only on max77686). The max77802 will
> only use parent's regmap.
>
> 2. It has different register address.
> We need a register-layout/configuration structure. The logic is the
> same except few differences (e.g. presence of MAX77802_RTC_AE1).
>
> It may be easier to merge them now, before adding support for max77620?
> I could handle this probably next week or in the following week
> (assuming someone would test max77802 because I don't have the hardware).
>
> Anyway I think we should develop these RTC patches having this in mind:
> merge all of them.
>
I think we can do the merging of max77802 and max77686 at second step.
At first, lets decouple the rtc-max77686.c with its mfd driver. This
will give better picture how will it be done.
Once this is there then max77620 can use this and in parallel, can be
work for max77802 to use the same driver.
Let's first conclude and get accpepted for max77686 and max77620 as both
of us have related HW to verify the changes.
next prev parent reply other threads:[~2016-01-14 12:01 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 9:17 [PATCH V2 0/6] Add support for MAXIM MAX77620/MAX20024 PMIC Laxman Dewangan
2016-01-12 9:17 ` [PATCH V2 1/6] DT: mfd: add device-tree binding doc fro PMIC max77620/max20024 Laxman Dewangan
[not found] ` <1452590273-16421-2-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-01-13 2:07 ` Rob Herring
2016-01-12 9:17 ` [PATCH V2 2/6] mfd: max77620: add core driver for MAX77620/MAX20024 Laxman Dewangan
2016-01-13 0:47 ` Krzysztof Kozlowski
2016-01-13 9:00 ` Laxman Dewangan
2016-01-13 10:11 ` Alexandre Belloni
2016-01-12 9:17 ` [PATCH V2 3/6] pinctrl: max77620: add pincontrol " Laxman Dewangan
2016-01-12 9:17 ` [PATCH V2 4/6] gpio: max77620: add gpio " Laxman Dewangan
2016-01-12 9:17 ` [PATCH V2 5/6] rtc: max77xxx: add RTC driver for Maxim MAX77xxx series RTC IP Laxman Dewangan
2016-01-13 0:06 ` Krzysztof Kozlowski
2016-01-13 4:07 ` Laxman Dewangan
2016-01-13 4:28 ` Krzysztof Kozlowski
2016-01-13 4:25 ` Laxman Dewangan
[not found] ` <5695D1AF.9000806-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-01-13 14:59 ` Laxman Dewangan
2016-01-14 0:50 ` Krzysztof Kozlowski
[not found] ` <5696F0C4.1060904-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-01-14 1:20 ` Krzysztof Kozlowski
2016-01-14 11:50 ` Laxman Dewangan [this message]
2016-01-15 1:50 ` Javier Martinez Canillas
2016-01-18 4:27 ` Krzysztof Kozlowski
2016-01-18 12:01 ` Laxman Dewangan
2016-01-18 12:52 ` Javier Martinez Canillas
2016-01-14 14:20 ` Mark Brown
2016-01-18 4:23 ` Krzysztof Kozlowski
2016-01-12 9:17 ` [PATCH V2 6/6] regulator: max77620: add regulator driver for max77620/max20024 Laxman Dewangan
2016-01-13 1:28 ` Krzysztof Kozlowski
2016-01-13 11:39 ` Laxman Dewangan
2016-01-13 11:57 ` Mark Brown
2016-01-13 12:05 ` Laxman Dewangan
2016-01-13 12:31 ` Mark Brown
2016-01-13 12:37 ` Laxman Dewangan
2016-01-13 13:09 ` Mark Brown
2016-01-13 13:11 ` Laxman Dewangan
[not found] ` <56964CEF.3030900-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-01-13 14:20 ` Mark Brown
2016-01-13 14:42 ` Laxman Dewangan
[not found] ` <56966242.4080601-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-01-13 15:51 ` Mark Brown
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=56978BA1.9050409@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=gnurou@gmail.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=k.kozlowski@samsung.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=rtc-linux@googlegroups.com \
--cc=swarren@nvidia.com \
--cc=treding@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).