27 May, 2011

38 commits

  • In the case of get_voltage callback is NULL, current implementation in
    _regulator_get_voltage will return -EINVAL.

    Also returns proper error if ret is negative value.

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • Adding support for the twl6025. Major difference in the twl6025 is the
    group functionality has been removed from the chip so this affects how
    regulators are enabled and disabled.

    The names of the regulators also changed.

    The DCDCs of the 6025 are software controllable as well.

    Since V1

    Use the features variable passed via platform data instead of calling
    global function.

    Change the very switch like if statements to be a more readable
    switch statement.

    Since V2

    twl6025 doesn't use remap so remove it from the macros.

    Since V3

    enable/disable functions for 4030/6030 were seperated upstream so rebase
    on top of this. Change DCDC reference to SMPS as this is used in TRM.
    Change list_voltage slightly to have less code.

    Signed-off-by: Graeme Gregory
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Graeme Gregory
     
  • TWL6030: regulator is disabled via VREG_STATE
    TWL4030: regulator is disabled via VREG_GRP
    Since there is nothing common, split twlreg_enable similar to other regulator_ops

    Signed-off-by: Balaji T K
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Balaji T K
     
  • TWL6030: regulator is enabled via VREG_STATE
    TWL4030: regulator is enabled via VREG_GRP
    Since there is nothing common, split twlreg_enable similar to other regulator_ops

    Signed-off-by: Balaji T K
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Balaji T K
     
  • The tps65911 chip introduces new features, including changes in
    the regulator module.

    - VDD1 and VDD2 remain unchanged.
    - VDD3 is now named VDDCTRL and has a wider voltage range.
    - LDOs are now named LDO1...8 and voltage ranges are sequential,
    making LDOs easier to handle.

    Signed-off-by: Jorge Eduardo Candelaria
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Jorge Eduardo Candelaria
     
  • We use val as array index,
    thus the valid value rangae for val should be 0 .. n_voltages-1.

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • Voltage values should be expressed in microvolts, not in milivolts.

    Signed-off-by: Fabio Estevam
    Signed-off-by: Ranjani Vaidyanathan
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Fabio Estevam
     
  • In current implementation, the original macro implementation assumes the caller
    pass the parameter starting from 1 (to match the register names in datasheet).
    Thus we have unneeded plus one then minus one operations
    when using MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros.

    This patch removes these macros to avoid unneeded plus one then minus one operations
    without reducing readability.

    Signed-off-by: Axel Lin
    Acked-by: Kyungmin Park
    Acked-by: MyungJoo Ham
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • When applying the set_voltage() requests from consumers skip over those
    consumers that haven't set anything, otherwise we'll come out with a
    maximum voltage of zero.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • If either a regulator driver can't tell us what the optimum mode is (or
    doesn't have modes in the first place) or the system doesn't allow DRMS
    changes then it's more helpful for users to just say that we're in the
    optimal mode, even if it's from a selection of one.

    Still report errors if the process of picking and setting a mode changes as
    this may indicate that we're stuck in a low power mode and unable to deliver
    a higher current that the consumer just asked for.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • fix unreachable code.

    Signed-off-by: Jonghwan Choi
    Signed-off-by: MyungJoo Ham
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Jonghwan Choi
     
  • Signed-off-by: Axel Lin
    Acked-by: Kyungmin Park
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • The desc_id variable should not be a static variable.

    The rest of the code assumes the desc_id must less than TPSxxxxx_NUM_REGULATOR.
    If we set desc_id to be a static variable, checking the return value of
    rdev_get_id() may return error.

    Signed-off-by: Axel Lin
    Cc: Anuj Aggarwal
    Cc: Graeme Gregory
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • I check this patch again and found this actually is not a bug
    because MC13xxx_DEFINE explictly defines the order of each entry in the array.

    Thus revert the patch.

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • These became unused with the IRQ removal patch, I'm fairly sure that a
    patch was sent earlier by someone else but it doesn't seem to have been
    applied and I don't have a copy sitting around any more.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • The regulator module consists of 3 DCDCs and 8 LDOs. The output
    voltages are configurable and are meant to supply power to the
    main processor and other components

    Signed-off-by: Graeme Gregory
    Signed-off-by: Jorge Eduardo Candelaria
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Graeme Gregory
     
  • Currently, we call mc13xxx_reg_read and mc13xxx_reg_rmw for the same register.
    This can be converted to simply a mc13xxx_reg_read and a mc13xxx_reg_write,
    thus save a redundant register read.

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • Some systems, particularly physically large systems used for early
    prototyping, may experience substantial voltage drops between the regulator
    and the consumers as a result of long traces in the system. With these
    systems voltages may need to be set higher than requested in order to
    ensure reliable system operation.

    Allow systems to work around such hardware issues by allowing constraints
    to supply an offset to be applied to any requested and reported voltages.
    This is not ideal, especially since the voltage drop may be load dependant,
    but is sufficient for most affected systems, it is not expected to be used
    in production hardware. The offset is applied after all constraint
    processing so constraints should be specified in terms of consumer values
    not physically configured values.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • supply_regulator_dev (using a struct pointer) has been deprecated in favour
    of supply_regulator (using a regulator name) for quite a few releases
    now with a warning generated if it is used and there are no current in tree
    users so just remove the code.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • In include/linux/mfd/mc13892.h, we define MC13892_VCOINCELL as 23.
    Thus VCOINCELL should be defined as 23th element in mc13892_regulators array, not the first one.
    This actually fixes an off-by-one bug while accessing mc13892_regulators array.

    For example,
    In mc13892_regulator_probe, we use MC13892_VCAM as array index of mc13892_regulators array.
    mc13892_regulators[MC13892_VCAM].desc.ops->set_mode
    = mc13892_vcam_set_mode;
    Currently, it access mc13892_regulators[12] ,which is VAUDIO not VCAM.

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • Don't go looking up the rdev pointer every time, just use a local variable
    like everything else.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • The second parameter of regulator_mode_constrain takes a pointer.

    This patch fixes below warning:
    drivers/regulator/core.c: In function 'regulator_set_mode':
    drivers/regulator/core.c:2014: warning: passing argument 2 of 'regulator_mode_constrain' makes pointer from integer without a cast
    drivers/regulator/core.c:200: note: expected 'int *' but argument is of type 'unsigned int'

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • Current set_mode logic does not support 6030. The logic for 4030 is
    not reusable for 6030 as the mode setting for 6030 now uses the new
    CFG_STATE register. We hence rename the old get_status as being
    specific to 4030.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Saquib Herman
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Saquib Herman
     
  • Current get_status logic does not support 6030 get_status.
    The logic for 4030 is not reusable for 6030 as the status
    check for 6030 now depends on the new CFG_STATE register.
    We hence rename the old get_status as being specific to
    4030 and remove the redundant check for the same.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Saquib Herman
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Saquib Herman
     
  • With TWL6030, it is not enough to ensure that the regulator is the
    group of P1 group (CPU/Linux), but we need to check the state as far
    as APP is concerned as well.

    Split the current is_enabled to 6030 and 4030 specific ones. This
    split impacts few macros and variables as well, but sets up the
    stage for further fixes to set_mode and get_status in subsequent
    patches.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Saquib Herman
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Saquib Herman
     
  • TWL6030 does not have remap register. The current implementation
    causes value of remap to be written to state register, accidentally
    causing the regulators which are probed to be switched on as well.
    This is wrong as regulators should be controllable based on calls
    to enable/disable for TWL regulator framework. Further, the values
    initialized make no sense as well. We hence remove this from the
    initalizers and also write to remap register only if the TWL
    is 4030.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Saquib Herman
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Saquib Herman
     
  • TWL6030 requires an additional register write to CFG_STATE register
    to explicitly state that the regulator is in a certain state. Merely
    associating the regulator with the group is not enough. Add the
    required register field definitions and fix the handling for
    TWL6030 enable/disable.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Saquib Herman
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Saquib Herman
     
  • Otherwise, calling platform_get_drvdata in tps6105x_regulator_remove
    returns NULL.

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • If a mode requested by a consumer is not allowed by constraints
    automatically fall back to a higher power mode if possible. This
    ensures that consumers get at least the output they requested while
    allowing machine drivers to transparently limit lower power modes
    if required.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • Fix printk format warning (seen on x86_64) and change to unsigned
    output format:

    drivers/regulator/88pm8607.c:417: warning: format '%d' expects type 'int', but argument 3 has type 'resource_size_t'

    Signed-off-by: Randy Dunlap
    Acked-by: Mark Brown
    Signed-off-by: Samuel Ortiz

    Randy Dunlap
     
  • Avoid to use constraint name in regulator driver. So use regulator id is used
    instead in platform driver.

    Signed-off-by: Haojian Zhuang
    Cc: Liam Girdwood
    Acked-by: Mark Brown
    Signed-off-by: Samuel Ortiz

    Haojian Zhuang
     
  • Force to enable i2c as power up/down sequence. Otherwise, SD/LDO can't
    be enabled or disabled via accessing i2c bus.

    Signed-off-by: Haojian Zhuang
    Cc: Liam Girdwood
    Acked-by: Mark Brown
    Signed-off-by: Samuel Ortiz

    Haojian Zhuang
     
  • With the addition of a platform device mfd_cell pointer, MFD drivers
    can go back to passing platform data back to their sub drivers.
    This allows for an mfd_cell->mfd_data removal and thus keep the
    sub drivers MFD agnostic. This is mostly needed for non MFD aware
    sub drivers.

    Acked-by: Linus Walleij
    Acked-by: Liam Girdwood
    Signed-off-by: Samuel Ortiz

    Samuel Ortiz
     
  • With the addition of a platform device mfd_cell pointer, MFD drivers
    can go back to passing platform back to their sub drivers.
    This allows for an mfd_cell->mfd_data removal and thus keep the
    sub drivers MFD agnostic. This is mostly needed for non MFD aware
    sub drivers.

    Cc: Mark Brown
    Cc: Liam Girdwood
    Cc: Richard Purdie
    Acked-by: Haojian Zhuang
    Signed-off-by: Samuel Ortiz

    Samuel Ortiz
     
  • With the addition of a platform device mfd_cell pointer, MFD drivers
    can go back to passing platform data back to their sub drivers.
    This allows for an mfd_cell->mfd_data removal and thus keep the
    sub drivers MFD agnostic. This is mostly needed for non MFD aware
    sub drivers.

    Cc: Mark Brown
    Cc: Liam Girdwood
    Cc: Linus Walleij
    Signed-off-by: Samuel Ortiz

    Samuel Ortiz
     
  • With the addition of a platform device mfd_cell pointer, MFD drivers
    can go back to passing platform data back to their sub drivers.
    This allows for an mfd_cell->mfd_data removal and thus keep the
    sub drivers MFD agnostic. This is mostly needed for non MFD aware
    sub drivers.

    Cc: Mark Brown
    Cc: Liam Girdwood
    Acked-by: Uwe Kleine-König
    Signed-off-by: Samuel Ortiz

    Samuel Ortiz
     
  • With the addition of a platform device mfd_cell pointer, MFD drivers
    can go back to passing platform data back to their sub drivers.
    This allows for an mfd_cell->mfd_data removal and thus keep the sub drivers
    MFD agnostic. This is mostly needed for non MFD aware sub drivers.

    Acked-by: Linus Walleij
    Signed-off-by: Samuel Ortiz

    Samuel Ortiz
     

25 May, 2011

1 commit

  • The DB8500 has ePOD:s (electronic power domains) which are possible
    to switch on/off to deactivate silicon blocks on the DB8500 SoC
    by cutting their power without retention. We model these as simple
    regulators with one bit on/off settings.

    Acked-by: Liam Girdwood
    Acked-by: Mark Brown
    Signed-off-by: Bengt Jonsson
    Signed-off-by: Sundar Iyer
    Signed-off-by: Jonas Aberg
    Signed-off-by: Virupax Sadashivpetimath
    Signed-off-by: Martin Persson
    Signed-off-by: Linus Walleij

    Bengt Jonsson
     

10 May, 2011

1 commit