Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac3c8304 authored by Matti J. Aaltonen's avatar Matti J. Aaltonen Committed by Linus Torvalds
Browse files

drivers/nfc/pn544.c: add missing regulator



The regulator framework is used for power management.  The regulators are
only named in the driver code, the actual control stuff is in the board
file for each architecture or use case.

The PN544 chip has three regulators that can be controlled or not -
depending on the architecture where the chip is being used.  So some of
the regulators may not be controllable.  In our current case the third
regulator, which was missing from the code, went unnoticed because we
didn't need to control it.  To be as general as possible - in this respect
- the driver needs to list all regulators.  Then the board file can be
used to actually set the usage.

Signed-off-by: default avatarMatti J. Aaltonen <matti.j.aaltonen@nokia.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d73fa4b9
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -60,7 +60,7 @@ enum pn544_irq {
struct pn544_info {
struct pn544_info {
	struct miscdevice miscdev;
	struct miscdevice miscdev;
	struct i2c_client *i2c_dev;
	struct i2c_client *i2c_dev;
	struct regulator_bulk_data regs[2];
	struct regulator_bulk_data regs[3];


	enum pn544_state state;
	enum pn544_state state;
	wait_queue_head_t read_wait;
	wait_queue_head_t read_wait;
@@ -74,6 +74,7 @@ struct pn544_info {


static const char reg_vdd_io[]	= "Vdd_IO";
static const char reg_vdd_io[]	= "Vdd_IO";
static const char reg_vbat[]	= "VBat";
static const char reg_vbat[]	= "VBat";
static const char reg_vsim[]	= "VSim";


/* sysfs interface */
/* sysfs interface */
static ssize_t pn544_test(struct device *dev,
static ssize_t pn544_test(struct device *dev,
@@ -740,6 +741,7 @@ static int __devinit pn544_probe(struct i2c_client *client,


	info->regs[0].supply = reg_vdd_io;
	info->regs[0].supply = reg_vdd_io;
	info->regs[1].supply = reg_vbat;
	info->regs[1].supply = reg_vbat;
	info->regs[2].supply = reg_vsim;
	r = regulator_bulk_get(&client->dev, ARRAY_SIZE(info->regs),
	r = regulator_bulk_get(&client->dev, ARRAY_SIZE(info->regs),
				 info->regs);
				 info->regs);
	if (r < 0)
	if (r < 0)