Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350642
b: refs/heads/master
c: c9ade0f
h: refs/heads/master
v: v3
  • Loading branch information
Lee Jones committed Jan 23, 2013
1 parent 80ddeac commit d2c9fed
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e07a56453b14b929cf01bf032cc3e3220094609c
refs/heads/master: c9ade0fca3f7939194677353097b16c9795df46b
3 changes: 3 additions & 0 deletions trunk/drivers/power/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -2764,6 +2764,9 @@ static int ab8500_charger_usb_notifier_call(struct notifier_block *nb,
enum ab8500_usb_state bm_usb_state;
unsigned mA = *((unsigned *)power);

if (!di)
return NOTIFY_DONE;

if (event != USB_EVENT_VBUS) {
dev_dbg(di->dev, "not a standard host, returning\n");
return NOTIFY_DONE;
Expand Down
22 changes: 21 additions & 1 deletion trunk/drivers/power/abx500_chargalg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,25 @@ static int abx500_chargalg_get_property(struct power_supply *psy,

/* Exposure to the sysfs interface */

/**
* abx500_chargalg_sysfs_show() - sysfs show operations
* @kobj: pointer to the struct kobject
* @attr: pointer to the struct attribute
* @buf: buffer that holds the parameter to send to userspace
*
* Returns a buffer to be displayed in user space
*/
static ssize_t abx500_chargalg_sysfs_show(struct kobject *kobj,
struct attribute *attr, char *buf)
{
struct abx500_chargalg *di = container_of(kobj,
struct abx500_chargalg, chargalg_kobject);

return sprintf(buf, "%d\n",
di->susp_status.ac_suspended &&
di->susp_status.usb_suspended);
}

/**
* abx500_chargalg_sysfs_charger() - sysfs store operations
* @kobj: pointer to the struct kobject
Expand Down Expand Up @@ -1721,7 +1740,7 @@ static ssize_t abx500_chargalg_sysfs_charger(struct kobject *kobj,
static struct attribute abx500_chargalg_en_charger = \
{
.name = "chargalg",
.mode = S_IWUSR,
.mode = S_IRUGO | S_IWUSR,
};

static struct attribute *abx500_chargalg_chg[] = {
Expand All @@ -1730,6 +1749,7 @@ static struct attribute *abx500_chargalg_chg[] = {
};

static const struct sysfs_ops abx500_chargalg_sysfs_ops = {
.show = abx500_chargalg_sysfs_show,
.store = abx500_chargalg_sysfs_charger,
};

Expand Down

0 comments on commit d2c9fed

Please sign in to comment.