Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1633560

Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215)

From "Alex A. Mihaylov" <minimumlaw@rambler.ru>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215)
Date 2017-05-01 08:20 +0200
Message-ID <tCcQF-5tc-9@gated-at.bofh.it> (permalink)
References <tBBHr-7p2-7@gated-at.bofh.it> <tBBHr-7p2-5@gated-at.bofh.it> <tBCWR-86K-3@gated-at.bofh.it> <tBPAK-7C7-27@gated-at.bofh.it> <tC46J-7Zu-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi!


30.04.17 23:53, Sebastian Reichel wrote::
>>>> Slave device provide software layer for access to internal registers
>>>> MAX17211/MAX17215 chip.
>>> Please convert this to regmap.There is no generic w1 handler, but you can provide custom
>>> read/write functions.
>> I think regmap be overkill for this driver. the perception.
> I did not ask for full usage of all regmap features. Just register
> the read/write handler as regmap handler and use regmap_read/write
> to get values.
>
OK, I think about this. But max17211-battery use ONLY 
w1_max12711x_reg_get(). This is very simple function.

Second function w1_max1721x_reg_set() writen for extend feature list 
(factory calibrating and init battery).  I think, this code must _NOT_ 
be writen, and must _NOT_ be accessible for end user. Change calibration 
values potentially can damage battery or device. Theory, I can unexport 
this function and remove them from drivers code.

So output registers of Maxim M5 Fuel Gauge algorithm very simple: one 
register - one value. In driver I have two points with bitfield. First - 
battery connected from power supply props. Second: very optional device 
type from probe. This value _NOT_ used from driver - just write device 
type, if manufacturer not fill this data in chip nvram.

This moment driver use 14 registers. Ok, let's some time above will be 
14*3=42 registers accessible with w1_max1721x_reg_get(). This value is 
greatly overestimated - so many properties are not in the class 
POWER_SUPPLY. But register range in MAX1721X is 0x1F0 (496 words or 992 
bytes) of RAM for cache registers. As embedded system developer I 
dislike so ram management.

As result I repeat: regmap will be overkill for this driver. But OK, I 
try to write this code. Just for fun.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215) "Alex A. Mihaylov" <minimumlaw@rambler.ru> - 2017-04-29 16:40 +0200
  Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26  (MAX17211/MAX17215) Sebastian Reichel <sre@kernel.org> - 2017-04-29 18:00 +0200
    Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26  (MAX17211/MAX17215) "Alex A. Mihaylov" <minimumlaw@rambler.ru> - 2017-04-30 07:30 +0200
      Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26  (MAX17211/MAX17215) Sebastian Reichel <sre@kernel.org> - 2017-04-30 23:00 +0200
        Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26  (MAX17211/MAX17215) "Alex A. Mihaylov" <minimumlaw@rambler.ru> - 2017-05-01 08:20 +0200

csiph-web