Re: [PATCH v3 09/13] thermal: qoriq: Convert driver to use regmap API

From: Daniel Lezcano
Date: Thu Apr 11 2019 - 09:01:00 EST


On 05/04/2019 20:24, Andrey Smirnov wrote:

[ ... ]

>>> +static const struct regmap_range qiriq_yes_ranges[] = {
>>> + regmap_reg_range(REGS_TMR, REGS_TSCFGR),
>>> + regmap_reg_range(REGS_TTRnCR(0), REGS_TTRnCR(3)),
>>> + /* Read only registers below */
>>> + regmap_reg_range(REGS_TRITSR(0), REGS_TRITSR(15)),
>>> +};
>>> +
>>> +static const struct regmap_access_table qiriq_wr_table = {
>>> + .yes_ranges = qiriq_yes_ranges,
>>> + .n_yes_ranges = ARRAY_SIZE(qiriq_yes_ranges) - 1,
>>> +};
>>> +
>>> +static const struct regmap_access_table qiriq_rd_table = {
>>> + .yes_ranges = qiriq_yes_ranges,
>>> + .n_yes_ranges = ARRAY_SIZE(qiriq_yes_ranges),
>>> +};
>>
>> As the table are the same, it would make sense to fold both structure to
>> a single one (and s/qiriq/qoriq/ ?)
>>
>
> Writable registers are a subset of readable registers and n_yes_ranges
> is different between the two. Not sure how I could fold the two into a
> single struct.

Right, never mind my comment.




--
<http://www.linaro.org/> Linaro.org â Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog