* max1363: internal reference
[not found] <235056967.112251.1389282903427.JavaMail.root@mail>
@ 2014-01-09 17:39 ` Vivien Didelot
2014-01-10 9:27 ` Lars-Peter Clausen
0 siblings, 1 reply; 3+ messages in thread
From: Vivien Didelot @ 2014-01-09 17:39 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, kernel
Hi Jonathan,
As described in the max1363.c header, the control of the internal
reference is not currently supported by the driver.
We have two max11603 and max11605 which need this option. We currently
use a monkey patch like this in max1363.c:
@@ -1414,7 +1414,12 @@ static const struct max1363_chip_info ma
static int max1363_initial_setup(struct max1363_state *st)
{
+#ifdef OUR_BOARD
+ st->setupbyte = MAX1363_SETUP_AIN3_IS_AIN3_REF_IS_INT
+#else
st->setupbyte = MAX1363_SETUP_AIN3_IS_AIN3_REF_IS_VDD
+#endif
| MAX1363_SETUP_POWER_UP_INT_REF
| MAX1363_SETUP_INT_CLOCK
| MAX1363_SETUP_UNIPOLAR
In order to add the support for this, I would suggest adding a
platform_data for this driver such as:
struct max1363_platform_data {
bool internal_reference;
};
What do you think?
Best,
Vivien
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: max1363: internal reference
2014-01-09 17:39 ` max1363: internal reference Vivien Didelot
@ 2014-01-10 9:27 ` Lars-Peter Clausen
2014-01-10 20:00 ` Vivien Didelot
0 siblings, 1 reply; 3+ messages in thread
From: Lars-Peter Clausen @ 2014-01-10 9:27 UTC (permalink / raw)
To: Vivien Didelot; +Cc: Jonathan Cameron, linux-iio, kernel
On 01/09/2014 06:39 PM, Vivien Didelot wrote:
> Hi Jonathan,
>
> As described in the max1363.c header, the control of the internal
> reference is not currently supported by the driver.
>
> We have two max11603 and max11605 which need this option. We currently
> use a monkey patch like this in max1363.c:
>
> @@ -1414,7 +1414,12 @@ static const struct max1363_chip_info ma
> static int max1363_initial_setup(struct max1363_state *st)
> {
> +#ifdef OUR_BOARD
> + st->setupbyte = MAX1363_SETUP_AIN3_IS_AIN3_REF_IS_INT
> +#else
> st->setupbyte = MAX1363_SETUP_AIN3_IS_AIN3_REF_IS_VDD
> +#endif
> | MAX1363_SETUP_POWER_UP_INT_REF
> | MAX1363_SETUP_INT_CLOCK
> | MAX1363_SETUP_UNIPOLAR
>
> In order to add the support for this, I would suggest adding a
> platform_data for this driver such as:
>
> struct max1363_platform_data {
> bool internal_reference;
> };
>
> What do you think?
Yes. But make sure to properly document the platform data struct with kernel
doc.
- Lars
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: max1363: internal reference
2014-01-10 9:27 ` Lars-Peter Clausen
@ 2014-01-10 20:00 ` Vivien Didelot
0 siblings, 0 replies; 3+ messages in thread
From: Vivien Didelot @ 2014-01-10 20:00 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Jonathan Cameron, linux-iio, kernel
My bad, since a405b00 external reference is supported if the device has
a regulator, and fallback to internal if it doesn't.
Best,
Vivien
----- Mail original -----
> De: "Lars-Peter Clausen" <lars@metafoo.de>
> =C3=80: "Vivien Didelot" <vivien.didelot@savoirfairelinux.com>
> Cc: "Jonathan Cameron" <jic23@kernel.org>, linux-iio@vger.kernel.org, ker=
nel@savoirfairelinux.com
> Envoy=C3=A9: Vendredi 10 Janvier 2014 04:27:43
> Objet: Re: max1363: internal reference
>=20
> On 01/09/2014 06:39 PM, Vivien Didelot wrote:
> > Hi Jonathan,
> >=20
> > As described in the max1363.c header, the control of the internal
> > reference is not currently supported by the driver.
> >=20
> > We have two max11603 and max11605 which need this option. We
> > currently
> > use a monkey patch like this in max1363.c:
> >=20
> > @@ -1414,7 +1414,12 @@ static const struct max1363_chip_info ma
> > static int max1363_initial_setup(struct max1363_state *st)
> > {
> > +#ifdef OUR_BOARD
> > + st->setupbyte =3D MAX1363_SETUP_AIN3_IS_AIN3_REF_IS_INT
> > +#else
> > st->setupbyte =3D MAX1363_SETUP_AIN3_IS_AIN3_REF_IS_VDD
> > +#endif
> > | MAX1363_SETUP_POWER_UP_INT_REF
> > | MAX1363_SETUP_INT_CLOCK
> > | MAX1363_SETUP_UNIPOLAR
> >=20
> > In order to add the support for this, I would suggest adding a
> > platform_data for this driver such as:
> >=20
> > struct max1363_platform_data {
> > bool internal_reference;
> > };
> >=20
> > What do you think?
>=20
> Yes. But make sure to properly document the platform data struct with
> kernel
> doc.
>=20
> - Lars
>=20
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-10 20:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <235056967.112251.1389282903427.JavaMail.root@mail>
2014-01-09 17:39 ` max1363: internal reference Vivien Didelot
2014-01-10 9:27 ` Lars-Peter Clausen
2014-01-10 20:00 ` Vivien Didelot
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.