Re: [PATCH 2/2] extcon: max77843: support USB accessories as external USB hosts

From: Andi Shyti
Date: Wed Mar 29 2017 - 10:57:15 EST


Hi Krzysztof,

> > + case MAX77843_MUIC_ADC_RESERVED_ACC_1:
> > + case MAX77843_MUIC_ADC_RESERVED_ACC_2:
> > + case MAX77843_MUIC_ADC_RESERVED_ACC_3:
> > + case MAX77843_MUIC_ADC_RESERVED_ACC_4:
> > + case MAX77843_MUIC_ADC_RESERVED_ACC_5:
>
> In commit msg you mentioned it but in code not. It looks weird to
> handle a vague "reserved" type in a specific way. How about adding
> some meaningful names instead of "reserved"? Or at least documenting,
> that they match Gear VR. Really, imagine later one would be looking at
> the code and trying to figure out why "reserved" means something

I know it's misleading, but that's the name from the datasheet,
that's why I tried to be more specific in the commit log.

In any case RESERVED_ACC stands for "reserved for external
accessory".

The Gear VR corresponds to MAX77843_MUIC_ADC_RESERVED_ACC_4, but
I don't think it's the only one, that's why it wouldn't be right
to call it e.g. MAX77843_MUIC_ADC_GEAR_VR.

I can of course add a comment on top of the above lines to make
it clearer.

Thanks,
Andi