[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d1bade77b5281c1de6b2ddcb4dbbd033e455a116.camel@linaro.org>
Date: Tue, 03 Dec 2024 11:06:14 +0000
From: André Draszik <andre.draszik@...aro.org>
To: Thomas Antoine <t.antoine@...ouvain.be>, Sebastian Reichel
<sre@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof Kozlowski
<krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Dimitri Fedrau
<dima.fedrau@...il.com>, Catalin Marinas <catalin.marinas@....com>, Will
Deacon <will@...nel.org>, Peter Griffin <peter.griffin@...aro.org>, Alim
Akhtar <alim.akhtar@...sung.com>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH 1/4] power: supply: add support for max77759 fuel gauge
On Tue, 2024-12-03 at 11:30 +0100, Thomas Antoine wrote:
>
> Should I explicitly deny their use in the code for the max77759 or is it
> just for information?
I'd probably do something like this, which will indeed deny their reading
and/or writing, both via debugfs, and also normal driver access via
readmap_read()/write() etc:
static const struct regmap_range max77759_registers[] = {
regmap_reg_range(0x00, 0x4f),
regmap_reg_range(0xb0, 0xbf),
regmap_reg_range(0xd0, 0xd0),
regmap_reg_range(0xdc, 0xdf),
regmap_reg_range(0xfb, 0xfb),
regmap_reg_range(0xff, 0xff),
};
static const struct regmap_range max77759_ro_registers[] = {
regmap_reg_range(0x3d, 0x3d),
regmap_reg_range(0xfb, 0xfb),
regmap_reg_range(0xff, 0xff),
};
static const struct regmap_access_table max77759_write_table = {
.yes_ranges = max77759_registers,
.n_yes_ranges = ARRAY_SIZE(max77759_registers),
.no_ranges = max77759_ro_registers,
.n_no_ranges = ARRAY_SIZE(max77759_ro_registers),
};
static const struct regmap_access_table max77759_rd_table = {
.yes_ranges = max77759_registers,
.n_yes_ranges = ARRAY_SIZE(max77759_registers),
};
static const struct regmap_config max77759_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = 0xff,
.wr_table = &max77759_write_table,
.rd_table = &max77759_rd_table,
.cache_type = REGCACHE_NONE,
};
And maybe without cache for now. Most are probably not cacheable anyway.
Cheers,
Andre'
Powered by blists - more mailing lists