Re: [PATCH] [MT6660] Mediatek Smart Amplifier Driver

From: Mark Brown
Date: Wed Sep 25 2019 - 12:51:04 EST


On Wed, Sep 25, 2019 at 06:04:23PM +0800, Richtek Jeff Chang wrote:
> Mark Brown æ 2019/9/4 äå7:56 åé:
> > On Wed, Sep 04, 2019 at 03:07:06PM +0800, Richtek Jeff Chang wrote:

> > > > It would be good to implement a regmap rather than open coding
> > > > *everything* - it'd give you things like this without needing to open
> > > > code them. Providing you don't use the cache code it should cope fine
> > > > with variable register sizes.

> > > Due to our hardware design, it is hard to implement regmap for MT6660.
> > You definitely can't use all the functionality due to the variable
> > register sizes but using reg_write() and reg_read() should get you most
> > of it.

> ÂÂÂ How can I fill the val_bits for variable register size?

> ÂÂÂ I try to use all 32 bits val_bits, but our chip some registers are
> overlap...

>  Do you have any suggestion for this issue? Thank you very much!

If you use reg_read() and reg_write() operations you can hide the
register size within them - the rest of the code thinks the
registers are all the 32 bits but when doing I/O it can use the
appropriate size for a given register.

> > > > > + for (i = 0; i < len; i++) {
> > > > > + ret = mt6660_i2c_update_bits(chip, init_table[i].addr,
> > > > > + init_table[i].mask, init_table[i].data);
> > > > > + if (ret < 0)
> > > > > + return ret;

> > > > Why are we not using the chip defaults here?

> > > Because MT6660 needs this initial setting for working well.
> > What are these settings? Are you sure they are generic settings and
> > not board specific?

> Yes, they are generic setting. It comes from our hardware designers.

You should probably be using the regmap register patch feature,
it's for things like this where the chip should always be used
with a different set of defaults to the silicon.

> Should I send new patch file to you in this mail loop, or I should send new
> patch via new Email Loop?

A new one please.

Attachment: signature.asc
Description: PGP signature