lkml.org 
[lkml]   [2012]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 2/3] regulator: max77686: Add support for various operating modes
    Date
    Currently, we cannot specify the regulator suspend state via device
    tree. Add an optional operating mode property which can be used to
    set initially the regulator mode.
    We are currently bypassing the set_suspend_disable and set_suspend_mode
    call-backs.

    Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
    ---
    drivers/regulator/max77686.c | 11 ++++++++++-
    include/linux/mfd/max77686.h | 1 +
    2 files changed, 11 insertions(+), 1 deletions(-)

    diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c
    index b85040c..7f16bc7 100644
    --- a/drivers/regulator/max77686.c
    +++ b/drivers/regulator/max77686.c
    @@ -410,6 +410,12 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev,
    of_regulator_match(iodev->dev, regulators_np, &rmatch, 1);
    rdata[i].initdata = rmatch.init_data;
    rdata[i].of_node = rmatch.of_node;
    + if (of_property_read_u32(rdata[i].of_node, "max77686-opmode",
    + &rdata[i].opmode)) {
    + dev_warn(iodev->dev, "no op_mode property property at %s\n",
    + rmatch.name);
    + rdata[i].opmode = regulators[i].enable_mask;
    + }
    }

    pdata->regulators = rdata;
    @@ -465,7 +471,10 @@ static int max77686_pmic_probe(struct platform_device *pdev)
    config.init_data = pdata->regulators[i].initdata;
    config.of_node = pdata->regulators[i].of_node;

    - max77686->opmode[i] = regulators[i].enable_mask;
    + if (config.of_node)
    + max77686->opmode[i] = pdata->regulators[i].opmode;
    + else
    + max77686->opmode[i] = regulators[i].enable_mask;
    max77686->rdev[i] = regulator_register(&regulators[i], &config);
    if (IS_ERR(max77686->rdev[i])) {
    ret = PTR_ERR(max77686->rdev[i]);
    diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h
    index 46c0f32..e8bd83b 100644
    --- a/include/linux/mfd/max77686.h
    +++ b/include/linux/mfd/max77686.h
    @@ -73,6 +73,7 @@ enum max77686_regulators {

    struct max77686_regulator_data {
    int id;
    + int opmode;
    struct regulator_init_data *initdata;
    struct device_node *of_node;
    };
    --
    1.7.8.6


    \
     
     \ /
      Last update: 2012-12-10 07:41    [W:2.256 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site