Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181086
b: refs/heads/master
c: 10ab92d
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Jan 15, 2010
1 parent 348bc2e commit f740a14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 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: 46c4e5daea3d5df06e27bf5a49a0c42274db6725
refs/heads/master: 10ab92d8c336c25af1fce46113ed85856e02e95d
22 changes: 17 additions & 5 deletions trunk/arch/sh/drivers/heartbeat.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Generic heartbeat driver for regular LED banks
*
* Copyright (C) 2007 Paul Mundt
* Copyright (C) 2007 - 2010 Paul Mundt
*
* Most SH reference boards include a number of individual LEDs that can
* be independently controlled (either via a pre-defined hardware
Expand All @@ -27,7 +27,7 @@
#include <asm/heartbeat.h>

#define DRV_NAME "heartbeat"
#define DRV_VERSION "0.1.1"
#define DRV_VERSION "0.1.2"

static unsigned char default_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };

Expand Down Expand Up @@ -98,7 +98,7 @@ static int heartbeat_drv_probe(struct platform_device *pdev)
return -ENOMEM;
}

hd->base = ioremap_nocache(res->start, res->end - res->start + 1);
hd->base = ioremap_nocache(res->start, resource_size(res));
if (unlikely(!hd->base)) {
dev_err(&pdev->dev, "ioremap failed\n");

Expand All @@ -117,8 +117,20 @@ static int heartbeat_drv_probe(struct platform_device *pdev)
for (i = 0; i < hd->nr_bits; i++)
hd->mask |= (1 << hd->bit_pos[i]);

if (!hd->regsize)
hd->regsize = 8; /* default access size */
if (!hd->regsize) {
switch (res->flags & IORESOURCE_MEM_TYPE_MASK) {
case IORESOURCE_MEM_32BIT:
hd->regsize = 32;
break;
case IORESOURCE_MEM_16BIT:
hd->regsize = 16;
break;
case IORESOURCE_MEM_8BIT:
default:
hd->regsize = 8;
break;
}
}

setup_timer(&hd->timer, heartbeat_timer, (unsigned long)hd);
platform_set_drvdata(pdev, hd);
Expand Down

0 comments on commit f740a14

Please sign in to comment.