lkml.org 
[lkml]   [2017]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 10/18] staging: typec: fusb302: Add support for fcs,vbus-regulator-name device-property
    On Mon, Aug 07, 2017 at 04:41:18PM +0200, Hans de Goede wrote:
    > On 07-08-17 13:10, Mark Brown wrote:

    > Problem 1)

    > The regulator in question is part of the bq24292i charger-IC attached to
    > a private i2c bus between the PMIC and the charger. The driver for the i2c
    > controller inside the PMIC which drivers this bus currently also instantiates
    > the i2c-client for the charger:

    ...

    > Note that the bq24190 driver is a generic driver, so to pass the
    > board specific regulator_init_data to it I would need to somehow
    > pass it here, but I don't see how, except by storing a pointer to
    > it in an u64 device-property which seems like a bad idea

    I2C has a perfectly good platform_data pointer in the board info for
    this stuff.

    > Problem 2)

    > Even if I could add the mapping through regulator_init_data
    > then it may well be too late, if the regulator_get happens
    > before the bq24190 driver registers its regulator (and thus
    > the mapping) the regulator_get for it may have already
    > happened and returned a dummy-regulator, or another regulator
    > with the rather generic vbus name.

    If you don't have control over the instantiation ordering but you have a
    firmware which claims to provide a complete description of regulators
    then you'd need to add an interface that allows mappings to be
    registered separately to regulator registration.

    Whatever you're doing the answer isn't to try to specify the name of the
    supply through some firmware binding, that's just obviously not sensible
    both in terms of a firmware abstraction and in terms of how the
    abstractions in Linux work.
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2017-08-07 17:43    [W:3.231 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site