All of lore.kernel.org
 help / color / mirror / Atom feed
From: Beomho Seo <beomho.seo@samsung.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: linux-kernel@vger.kernel.org, cw00.choi@samsung.com,
	sangbae90.lee@samsung.com, inki.dae@samsung.com,
	linux-pm@vger.kernel.org, myungjoo.ham@samsung.com,
	Sebastian Reichel <sre@kernel.org>,
	jonghwa3.lee@samsung.comlinux-pm@vger.kernel.org,
	beomho.seo@samsung.com
Subject: Re: [PATCH 1/3] power: max17042_battery: Use reg type instead of chip type
Date: Wed, 01 Apr 2015 18:00:44 +0900	[thread overview]
Message-ID: <551BB3BC.8030501@samsung.com> (raw)
In-Reply-To: <CAJKOXPdM1zt_y19Lv8Q6PPLzhOJSw3JaLRgi=ziaNsg0p=-ieg@mail.gmail.com>

On 04/01/2015 05:18 PM, Krzysztof Kozlowski wrote:
> 2015-03-31 15:29 GMT+02:00 Beomho Seo <beomho.seo@samsung.com>:
>> Currently, max17042 battery driver choose register map by MAX17042_DevName
>> register. But thid register is return IC specific firmware version. So other
>> maxim chip hard to use this drvier. This patch choose reg_type by driver_data.
> 
> I don't quite get the concept of "reg_type" and why it replaces chip
> type? It seems that you choose reg_type based on given chip type so
> there is direct mapping chip_type->reg_type. If max17047 and max17050
> are the same from the point of view of interface (registers) then they
> should use the same compatible or the same device type. Something
> like:
> 

When I check datasheet, MAX17042_DevName register return Firmware version.
Firmware version not chip type. For use other maxim chip, be better use
of_id->data or id->driver_data(be like other maxim mfd driver)

I will remove reg_type. and chip_type will be assigned through
of_id->data or id->driver_data.

>>  static const struct i2c_device_id max17042_id[] = {
>> -       { "max17042", 0 },
>> -       { "max17047", 1 },
>> -       { "max17050", 2 },
>> +       { "max17042", MAXIM_DEVICE_TYPE_MAX17042 },
>> +       { "max17047", MAXIM_DEVICE_TYPE_MAX17047 },
>> +       { "max17050", MAXIM_DEVICE_TYPE_MAX17047 }, /* Same as 17047 */
>>         { }
> 
> So why you are adding the conversion from i2c_device_id -> reg_type?
> 
> Beside that, thanks for integrating this into existing driver! Much appreciated.
> 
> Best regards,
> Krzysztof
> 

Best regards,
Beomho


WARNING: multiple messages have this Message-ID (diff)
From: Beomho Seo <beomho.seo@samsung.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: linux-kernel@vger.kernel.org, cw00.choi@samsung.com,
	sangbae90.lee@samsung.com, inki.dae@samsung.com,
	linux-pm@vger.kernel.org, myungjoo.ham@samsung.com,
	Sebastian Reichel <sre@kernel.org>,
	jonghwa3.lee@samsung.com, linux-pm@vger.kernel.org,
	beomho.seo@samsung.com
Subject: Re: [PATCH 1/3] power: max17042_battery: Use reg type instead of chip type
Date: Wed, 01 Apr 2015 18:00:44 +0900	[thread overview]
Message-ID: <551BB3BC.8030501@samsung.com> (raw)
In-Reply-To: <CAJKOXPdM1zt_y19Lv8Q6PPLzhOJSw3JaLRgi=ziaNsg0p=-ieg@mail.gmail.com>

On 04/01/2015 05:18 PM, Krzysztof Kozlowski wrote:
> 2015-03-31 15:29 GMT+02:00 Beomho Seo <beomho.seo@samsung.com>:
>> Currently, max17042 battery driver choose register map by MAX17042_DevName
>> register. But thid register is return IC specific firmware version. So other
>> maxim chip hard to use this drvier. This patch choose reg_type by driver_data.
> 
> I don't quite get the concept of "reg_type" and why it replaces chip
> type? It seems that you choose reg_type based on given chip type so
> there is direct mapping chip_type->reg_type. If max17047 and max17050
> are the same from the point of view of interface (registers) then they
> should use the same compatible or the same device type. Something
> like:
> 

When I check datasheet, MAX17042_DevName register return Firmware version.
Firmware version not chip type. For use other maxim chip, be better use
of_id->data or id->driver_data(be like other maxim mfd driver)

I will remove reg_type. and chip_type will be assigned through
of_id->data or id->driver_data.

>>  static const struct i2c_device_id max17042_id[] = {
>> -       { "max17042", 0 },
>> -       { "max17047", 1 },
>> -       { "max17050", 2 },
>> +       { "max17042", MAXIM_DEVICE_TYPE_MAX17042 },
>> +       { "max17047", MAXIM_DEVICE_TYPE_MAX17047 },
>> +       { "max17050", MAXIM_DEVICE_TYPE_MAX17047 }, /* Same as 17047 */
>>         { }
> 
> So why you are adding the conversion from i2c_device_id -> reg_type?
> 
> Beside that, thanks for integrating this into existing driver! Much appreciated.
> 
> Best regards,
> Krzysztof
> 

Best regards,
Beomho


  reply	other threads:[~2015-04-01  9:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 13:29 [PATCH 0/3] power: max17042-battery: Modify max17042 battery driver Beomho Seo
2015-03-31 13:29 ` [PATCH 1/3] power: max17042_battery: Use reg type instead of chip type Beomho Seo
2015-04-01  8:18   ` Krzysztof Kozlowski
2015-04-01  9:00     ` Beomho Seo [this message]
2015-04-01  9:00       ` Beomho Seo
2015-03-31 13:29 ` [PATCH 2/3] power: max17042_battery: Add support for max77693/843 chip Beomho Seo
2015-04-01  8:27   ` Krzysztof Kozlowski
2015-04-01  8:35     ` Beomho Seo
2015-03-31 13:29 ` [PATCH 3/3] power: max17042_battery: add missed blank Beomho Seo
2015-04-01  8:21   ` Krzysztof Kozlowski
  -- strict thread matches above, loose matches on Subject: below --
2015-03-31 13:34 [PATCH 0/3] power: max17042-battery: Modify max17042 battery driver Beomho Seo
2015-03-31 13:34 ` [PATCH 1/3] power: max17042_battery: Use reg type instead of chip type Beomho Seo
2015-03-31 15:31   ` Sebastian Reichel
2015-04-01  0:03     ` Beomho Seo

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=551BB3BC.8030501@samsung.com \
    --to=beomho.seo@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=inki.dae@samsung.com \
    --cc=jonghwa3.lee@samsung.comlinux-pm \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=sangbae90.lee@samsung.com \
    --cc=sre@kernel.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.