Messages in this thread | | | Date | Mon, 22 Aug 2011 01:05:11 +0200 | From | Samuel Ortiz <> | 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.
> +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 ?
Cheers, Samuel.
-- Intel Open Source Technology Centre http://oss.intel.com/
| |