Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367456
b: refs/heads/master
c: 93ff722
h: refs/heads/master
v: v3
  • Loading branch information
Lee Jones committed Mar 7, 2013
1 parent ad732e7 commit bb54d24
Show file tree
Hide file tree
Showing 6 changed files with 544 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 330b7ebfa59d70ea5b814a04a28b8c7d8e462a81
refs/heads/master: 93ff722e88530b9719cbf53be4f3197722461394
36 changes: 36 additions & 0 deletions trunk/drivers/mfd/ab8500-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
#define AB8500_SWITCH_OFF_STATUS 0x00

#define AB8500_TURN_ON_STATUS 0x00
#define AB8505_TURN_ON_STATUS_2 0x04

#define AB8500_CH_USBCH_STAT1_REG 0x02
#define VBUS_DET_DBNC100 0x02
Expand Down Expand Up @@ -1401,6 +1402,21 @@ static ssize_t show_turn_on_status(struct device *dev,
return sprintf(buf, "%#x\n", value);
}

static ssize_t show_turn_on_status_2(struct device *dev,
struct device_attribute *attr, char *buf)
{
int ret;
u8 value;
struct ab8500 *ab8500;

ab8500 = dev_get_drvdata(dev);
ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK,
AB8505_TURN_ON_STATUS_2, &value);
if (ret < 0)
return ret;
return sprintf(buf, "%#x\n", (value & 0x1));
}

static ssize_t show_ab9540_dbbrstn(struct device *dev,
struct device_attribute *attr, char *buf)
{
Expand Down Expand Up @@ -1457,6 +1473,7 @@ static ssize_t store_ab9540_dbbrstn(struct device *dev,
static DEVICE_ATTR(chip_id, S_IRUGO, show_chip_id, NULL);
static DEVICE_ATTR(switch_off_status, S_IRUGO, show_switch_off_status, NULL);
static DEVICE_ATTR(turn_on_status, S_IRUGO, show_turn_on_status, NULL);
static DEVICE_ATTR(turn_on_status_2, S_IRUGO, show_turn_on_status_2, NULL);
static DEVICE_ATTR(dbbrstn, S_IRUGO | S_IWUSR,
show_ab9540_dbbrstn, store_ab9540_dbbrstn);

Expand All @@ -1467,6 +1484,11 @@ static struct attribute *ab8500_sysfs_entries[] = {
NULL,
};

static struct attribute *ab8505_sysfs_entries[] = {
&dev_attr_turn_on_status_2.attr,
NULL,
};

static struct attribute *ab9540_sysfs_entries[] = {
&dev_attr_chip_id.attr,
&dev_attr_switch_off_status.attr,
Expand All @@ -1479,6 +1501,10 @@ static struct attribute_group ab8500_attr_group = {
.attrs = ab8500_sysfs_entries,
};

static struct attribute_group ab8505_attr_group = {
.attrs = ab8505_sysfs_entries,
};

static struct attribute_group ab9540_attr_group = {
.attrs = ab9540_sysfs_entries,
};
Expand Down Expand Up @@ -1719,6 +1745,12 @@ static int ab8500_probe(struct platform_device *pdev)
else
ret = sysfs_create_group(&ab8500->dev->kobj,
&ab8500_attr_group);

if ((is_ab8505(ab8500) || is_ab9540(ab8500)) &&
ab8500->chip_id >= AB8500_CUT2P0)
ret = sysfs_create_group(&ab8500->dev->kobj,
&ab8505_attr_group);

if (ret)
dev_err(ab8500->dev, "error creating sysfs entries\n");

Expand All @@ -1735,6 +1767,10 @@ static int ab8500_remove(struct platform_device *pdev)
else
sysfs_remove_group(&ab8500->dev->kobj, &ab8500_attr_group);

if ((is_ab8505(ab8500) || is_ab9540(ab8500)) &&
ab8500->chip_id >= AB8500_CUT2P0)
sysfs_remove_group(&ab8500->dev->kobj, &ab8505_attr_group);

mfd_remove_devices(ab8500->dev);

return 0;
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/power/ab8500_bmdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ static const struct abx500_fg_parameters fg = {
.battok_raising_th_sel1 = 2860,
.maint_thres = 95,
.user_cap_limit = 15,
.pcut_enable = 1,
.pcut_max_time = 127,
.pcut_flag_time = 112,
.pcut_max_restart = 15,
.pcut_debounce_time = 2,
};

static const struct abx500_maxim_parameters maxi_params = {
Expand Down
Loading

0 comments on commit bb54d24

Please sign in to comment.