All of lore.kernel.org
 help / color / mirror / Atom feed
* regulator: mt6358 vdram2_idx/vsel_mask/ vsel_shift setting seems wrong
@ 2021-06-22  3:20 ` Axel Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2021-06-22  3:20 UTC (permalink / raw)
  To: Hsin-Hsiung Wang; +Cc: Mark Brown, Liam Girdwood, LKML, linux-mediatek

Hi Hsin-Hsiung,

In drivers/regulator/mt6358-regulator.c:

static const u32 vdram2_idx[] = {
        0, 12,
};

MT6358_LDO("ldo_vdram2", VDRAM2, vdram2_voltages, vdram2_idx,
           MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0x10, 0),

With current setting the vsel_mask does not match the vsel_shift setting
   So in set_voltage_sel, it will call regmap_update_bits with
   mask = 0x10
   val = idx << 0
   No matter idx is 0 (pvol[0]) or 12 (pvol[1]), it will clear vsel_mask bits

I don't have the datasheet to check, so please help to double check the
vdram2_idx, vsel_mask and vsel_shift settings for ldo_vdram2.
I think at least one of the settings is wrong.

Regards,
Axel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* regulator: mt6358 vdram2_idx/vsel_mask/ vsel_shift setting seems wrong
@ 2021-06-22  3:20 ` Axel Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2021-06-22  3:20 UTC (permalink / raw)
  To: Hsin-Hsiung Wang; +Cc: Mark Brown, Liam Girdwood, LKML, linux-mediatek

Hi Hsin-Hsiung,

In drivers/regulator/mt6358-regulator.c:

static const u32 vdram2_idx[] = {
        0, 12,
};

MT6358_LDO("ldo_vdram2", VDRAM2, vdram2_voltages, vdram2_idx,
           MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0x10, 0),

With current setting the vsel_mask does not match the vsel_shift setting
   So in set_voltage_sel, it will call regmap_update_bits with
   mask = 0x10
   val = idx << 0
   No matter idx is 0 (pvol[0]) or 12 (pvol[1]), it will clear vsel_mask bits

I don't have the datasheet to check, so please help to double check the
vdram2_idx, vsel_mask and vsel_shift settings for ldo_vdram2.
I think at least one of the settings is wrong.

Regards,
Axel

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: regulator: mt6358 vdram2_idx/vsel_mask/ vsel_shift setting seems wrong
  2021-06-22  3:20 ` Axel Lin
@ 2021-06-23  5:02   ` Hsin-hsiung Wang
  -1 siblings, 0 replies; 4+ messages in thread
From: Hsin-hsiung Wang @ 2021-06-23  5:02 UTC (permalink / raw)
  To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, LKML, linux-mediatek, fan.chen

Hi, Axel sir
After checking the spec, the vsel_mask is wrong.
I submit a patch to fix it.
Many thanks for the correcting. :)

On Tue, 2021-06-22 at 11:20 +0800, Axel Lin wrote:
> Hi Hsin-Hsiung,
> 
> In drivers/regulator/mt6358-regulator.c:
> 
> static const u32 vdram2_idx[] = {
>         0, 12,
> };
> 
> MT6358_LDO("ldo_vdram2", VDRAM2, vdram2_voltages, vdram2_idx,
>            MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0x10, 0),
> 
> With current setting the vsel_mask does not match the vsel_shift setting
>    So in set_voltage_sel, it will call regmap_update_bits with
>    mask = 0x10
>    val = idx << 0
>    No matter idx is 0 (pvol[0]) or 12 (pvol[1]), it will clear vsel_mask bits
> 
> I don't have the datasheet to check, so please help to double check the
> vdram2_idx, vsel_mask and vsel_shift settings for ldo_vdram2.
> I think at least one of the settings is wrong.
> 
> Regards,
> Axel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: regulator: mt6358 vdram2_idx/vsel_mask/ vsel_shift setting seems wrong
@ 2021-06-23  5:02   ` Hsin-hsiung Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Hsin-hsiung Wang @ 2021-06-23  5:02 UTC (permalink / raw)
  To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, LKML, linux-mediatek, fan.chen

Hi, Axel sir
After checking the spec, the vsel_mask is wrong.
I submit a patch to fix it.
Many thanks for the correcting. :)

On Tue, 2021-06-22 at 11:20 +0800, Axel Lin wrote:
> Hi Hsin-Hsiung,
> 
> In drivers/regulator/mt6358-regulator.c:
> 
> static const u32 vdram2_idx[] = {
>         0, 12,
> };
> 
> MT6358_LDO("ldo_vdram2", VDRAM2, vdram2_voltages, vdram2_idx,
>            MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0x10, 0),
> 
> With current setting the vsel_mask does not match the vsel_shift setting
>    So in set_voltage_sel, it will call regmap_update_bits with
>    mask = 0x10
>    val = idx << 0
>    No matter idx is 0 (pvol[0]) or 12 (pvol[1]), it will clear vsel_mask bits
> 
> I don't have the datasheet to check, so please help to double check the
> vdram2_idx, vsel_mask and vsel_shift settings for ldo_vdram2.
> I think at least one of the settings is wrong.
> 
> Regards,
> Axel

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-23  5:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22  3:20 regulator: mt6358 vdram2_idx/vsel_mask/ vsel_shift setting seems wrong Axel Lin
2021-06-22  3:20 ` Axel Lin
2021-06-23  5:02 ` Hsin-hsiung Wang
2021-06-23  5:02   ` Hsin-hsiung Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.