aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-ich.c
diff options
context:
space:
mode:
authorVincent Donnefort <vdonnefort@gmail.com>2014-02-14 09:01:55 -0500
committerLee Jones <lee.jones@linaro.org>2014-03-19 04:58:21 -0400
commitba7f74fe2bbac3a3bcc709e60066d3768a55ca7f (patch)
tree85765419a89da331b69fec28d168df92882d1694 /drivers/gpio/gpio-ich.c
parentfacd9939403cb5769190054a600474399e776e3a (diff)
gpio: ich: Add blink capability option
This patch allows gpio_ich driver to be aware of non blink capable chipsets. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-ich.c')
-rw-r--r--drivers/gpio/gpio-ich.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
index f5bf3c38bca6..82887c53be38 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -62,6 +62,9 @@ struct ichx_desc {
62 /* Max GPIO pins the chipset can have */ 62 /* Max GPIO pins the chipset can have */
63 uint ngpio; 63 uint ngpio;
64 64
65 /* GPO_BLINK is available on this chipset */
66 bool have_blink;
67
65 /* Whether the chipset has GPIO in GPE0_STS in the PM IO region */ 68 /* Whether the chipset has GPIO in GPE0_STS in the PM IO region */
66 bool uses_gpe0; 69 bool uses_gpe0;
67 70
@@ -151,7 +154,7 @@ static int ichx_gpio_direction_output(struct gpio_chip *gpio, unsigned nr,
151 int val) 154 int val)
152{ 155{
153 /* Disable blink hardware which is available for GPIOs from 0 to 31. */ 156 /* Disable blink hardware which is available for GPIOs from 0 to 31. */
154 if (nr < 32) 157 if (nr < 32 && ichx_priv.desc->have_blink)
155 ichx_write_bit(GPO_BLINK, nr, 0, 0); 158 ichx_write_bit(GPO_BLINK, nr, 0, 0);
156 159
157 /* Set GPIO output value. */ 160 /* Set GPIO output value. */
@@ -266,6 +269,7 @@ static struct ichx_desc ich6_desc = {
266 .uses_gpe0 = true, 269 .uses_gpe0 = true,
267 270
268 .ngpio = 50, 271 .ngpio = 50,
272 .have_blink = true,
269}; 273};
270 274
271/* Intel 3100 */ 275/* Intel 3100 */
@@ -290,19 +294,23 @@ static struct ichx_desc i3100_desc = {
290/* ICH7 and ICH8-based */ 294/* ICH7 and ICH8-based */
291static struct ichx_desc ich7_desc = { 295static struct ichx_desc ich7_desc = {
292 .ngpio = 50, 296 .ngpio = 50,
297 .have_blink = true,
293}; 298};
294 299
295/* ICH9-based */ 300/* ICH9-based */
296static struct ichx_desc ich9_desc = { 301static struct ichx_desc ich9_desc = {
297 .ngpio = 61, 302 .ngpio = 61,
303 .have_blink = true,
298}; 304};
299 305
300/* ICH10-based - Consumer/corporate versions have different amount of GPIO */ 306/* ICH10-based - Consumer/corporate versions have different amount of GPIO */
301static struct ichx_desc ich10_cons_desc = { 307static struct ichx_desc ich10_cons_desc = {
302 .ngpio = 61, 308 .ngpio = 61,
309 .have_blink = true,
303}; 310};
304static struct ichx_desc ich10_corp_desc = { 311static struct ichx_desc ich10_corp_desc = {
305 .ngpio = 72, 312 .ngpio = 72,
313 .have_blink = true,
306}; 314};
307 315
308/* Intel 5 series, 6 series, 3400 series, and C200 series */ 316/* Intel 5 series, 6 series, 3400 series, and C200 series */