lkml.org 
[lkml]   [2015]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] power: max17042_battery: Use reg type instead of chip type
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



\
 
 \ /
  Last update: 2015-04-01 11:41    [W:0.069 / U:2.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site