Skip to contentSkip to conversation

max1363: internal reference

DISCUSSION Vivien Didelot 2 participants 3 messages Jan 9, 2014 – Jan 10, 2014 1 message not in the archive IIO

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

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

#2 lore raw
Quoted 20 lines · Vivien Didelot

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
Quoted 8 lines

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

#3 lore raw

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 -----

Quoted 3 lines

De: "Lars-Peter Clausen" <[email protected]>
=C3=80: "Vivien Didelot" <[email protected]>
Cc: "Jonathan Cameron" <[email protected]>, [email protected], ker=

[email protected]

Quoted 40 lines

Envoy=C3=A9: Vendredi 10 Janvier 2014 04:27:43
Objet: Re: max1363: internal reference
=20

Quoted 24 lines · Vivien Didelot

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

Quoted 5 lines
    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