lkml.org 
[lkml]   [2011]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRE: [PATCH] mfd: tps6586x: add api to power off tps6586x
    Hi, Samuel
    Thanks for your comments.
    Please check the following lines with [Wei Ni]

    Thanks
    Wei.


    >-----Original Message-----
    >From: Samuel Ortiz [mailto:sameo@linux.intel.com]
    >Sent: Monday, August 22, 2011 7:05 AM
    >To: Wei Ni
    >Cc: mike@compulab.co.il; gking@nvidia.com; Nitin Kumbhar; linux-kernel@vger.kernel.org
    >Subject: Re: [PATCH] mfd: tps6586x: add api to power off tps6586x
    >
    >Hi Wei,
    >
    >On Thu, Jul 28, 2011 at 02:30:36PM +0800, wni@nvidia.com wrote:
    >> +static struct i2c_client *tps6586x_i2c_client;
    >That's not vey nice. By doing so, you're preventing anyone to have more than
    >one of those chips in their boards.
    [Wei Ni] oh yes, I didn’t consider this issue. We use i2c_register_board_info()
    to register the tps6586x in the board file, but it didn't return the handle.
    Do you have any ideas?
    >
    >
    >> +int tps6586x_power_off(void)
    >> +{
    >> + struct device *dev = NULL;
    >> + int ret = -EINVAL;
    >> +
    >> + if (!tps6586x_i2c_client)
    >> + return ret;
    >> +
    >> + dev = &tps6586x_i2c_client->dev;
    >> +
    >> + ret = tps6586x_clr_bits(dev, TPS6586X_SUPPLYENE, EXITSLREQ_BIT);
    >> + if (ret)
    >> + return ret;
    >> +
    >> + ret = tps6586x_set_bits(dev, TPS6586X_SUPPLYENE, SLEEP_MODE_BIT);
    >> + if (ret)
    >> + return ret;
    >> +
    >> + return 0;
    >> +}
    >> +EXPORT_SYMBOL_GPL(tps6586x_power_off);
    >Who is going to call this one ?
    [Wei Ni] the tegra board will call this function to power off system.
    It will put tps6586x in sleep mode by resetting EXITSLREQ and
    setting SLEEP_MODE in SUPPLYENE register. It will power off ldos.
    >
    >Cheers,
    >Samuel.
    >
    >--
    >Intel Open Source Technology Centre
    >http://oss.intel.com/
    \
     
     \ /
      Last update: 2011-08-22 05:49    [W:0.027 / U:65.960 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site