Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365663
b: refs/heads/master
c: 4d22f8c
h: refs/heads/master
i:
  365661: 73d448f
  365659: 449821f
  365655: 37659b5
  365647: da08b72
  365631: 0aeba03
v: v3
  • Loading branch information
Matus Ujhelyi authored and Linus Torvalds committed Apr 30, 2013
1 parent 5a01943 commit d2b542c
Show file tree
Hide file tree
Showing 4 changed files with 19 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: 17e45db62a4683a7318294d652895dfad575da41
refs/heads/master: 4d22f8c306233433bdf9298b2e7806e9c71674bc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Required properties:
- backlight: node for specifying WLED1 and WLED2 lines in TPS65217
- isel: selection bit, valid values: 1 for ISEL1 (low-level) and 2 for ISEL2 (high-level)
- fdim: PWM dimming frequency, valid values: 100, 200, 500, 1000
- default-brightness: valid values: 0-100

Each regulator is defined using the standard binding for regulators.

Expand All @@ -20,5 +21,7 @@ Example:
backlight {
isel = <1>; /* 1 - ISET1, 2 ISET2 */
fdim = <100>; /* TPS65217_BL_FDIM_100HZ */
default-brightness = <50>;
};
};

15 changes: 14 additions & 1 deletion trunk/drivers/video/backlight/tps65217_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,18 @@ tps65217_bl_parse_dt(struct platform_device *pdev)
}
}

if (!of_property_read_u32(node, "default-brightness", &val)) {
if (val < 0 ||
val > 100) {
dev_err(&pdev->dev,
"invalid 'default-brightness' value in the device tree\n");
err = ERR_PTR(-EINVAL);
goto err;
}

pdata->dft_brightness = val;
}

of_node_put(node);

return pdata;
Expand Down Expand Up @@ -311,7 +323,8 @@ static int tps65217_bl_probe(struct platform_device *pdev)
return PTR_ERR(tps65217_bl->bl);
}

tps65217_bl->bl->props.brightness = 0;
tps65217_bl->bl->props.brightness = pdata->dft_brightness;
backlight_update_status(tps65217_bl->bl);
platform_set_drvdata(pdev, tps65217_bl);

return 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mfd/tps65217.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ enum tps65217_bl_fdim {
struct tps65217_bl_pdata {
enum tps65217_bl_isel isel;
enum tps65217_bl_fdim fdim;
int dft_brightness;
};

/**
Expand Down

0 comments on commit d2b542c

Please sign in to comment.