Re: [PATCH] mfd: tps6586x: add api to power off tps6586x

From: Samuel Ortiz
Date: Sun Aug 21 2011 - 19:03:15 EST


Hi Wei,

On Thu, Jul 28, 2011 at 02:30:36PM +0800, wni@xxxxxxxxxx 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/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/