Skip to contentSkip to conversation

bfin_rotary: replace bfin specific MMR function with generic IO function

PATCH New Sonic Zhang 1 participant 1 message Feb 5, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v4 3/3 bfin_rotary: replace bfin specific MMR function with generic IO function

From: Sonic Zhang <[email protected]>

- use readw and writew to access rotary MMRs
- remap rotary register physical address into kernel space in probe

v2-changes:
- replace kzalloc with devm_kzalloc
- replace request_irq with devm_request_irq
- remove memory free and irq free from the device remove function

v3-changes:
- move managed resources to a separate patch

v4-changes:
- remap rotary register physical address into kernel space in probe

---
 arch/blackfin/mach-bf527/boards/ad7160eval.c |    5 +++
 arch/blackfin/mach-bf527/boards/ezkit.c      |    5 +++
 arch/blackfin/mach-bf548/boards/ezkit.c      |    5 +++
 arch/blackfin/mach-bf609/boards/ezkit.c      |    5 +++
 drivers/input/misc/bfin_rotary.c             |   62 ++++++++++++++++++--------
 5 files changed, 63 insertions(+), 19 deletions(-)
arch/blackfin/mach-bf527/boards/ad7160eval.c +5 -0
index 029a050..68f2a8a 100644
@@ -688,6 +688,11 @@ static struct bfin_rotary_platform_data bfin_rotary_data = {
 
 static struct resource bfin_rotary_resources[] = {
 	{
+		.start = CNT_CONFIG,
+		.end   = CNT_CONFIG + 0xff,
+		.flags = IORESOURCE_MEM,
+	},
+	{
 		.start = IRQ_CNT,
 		.end = IRQ_CNT,
 		.flags = IORESOURCE_IRQ,
arch/blackfin/mach-bf527/boards/ezkit.c +5 -0
index cc80c5b..d4219e8 100644
@@ -1114,6 +1114,11 @@ static struct bfin_rotary_platform_data bfin_rotary_data = {
 
 static struct resource bfin_rotary_resources[] = {
 	{
+		.start = CNT_CONFIG,
+		.end   = CNT_CONFIG + 0xff,
+		.flags = IORESOURCE_MEM,
+	},
+	{
 		.start = IRQ_CNT,
 		.end = IRQ_CNT,
 		.flags = IORESOURCE_IRQ,
arch/blackfin/mach-bf548/boards/ezkit.c +5 -0
index 8f70f83..4204b98 100644
@@ -173,6 +173,11 @@ static struct bfin_rotary_platform_data bfin_rotary_data = {
 
 static struct resource bfin_rotary_resources[] = {
 	{
+		.start = CNT_CONFIG,
+		.end   = CNT_CONFIG + 0xff,
+		.flags = IORESOURCE_MEM,
+	},
+	{
 		.start = IRQ_CNT,
 		.end = IRQ_CNT,
 		.flags = IORESOURCE_IRQ,
arch/blackfin/mach-bf609/boards/ezkit.c +5 -0
index f9dc64d..7f9fc27 100644
@@ -88,6 +88,11 @@ static struct bfin_rotary_platform_data bfin_rotary_data = {
 
 static struct resource bfin_rotary_resources[] = {
 	{
+		.start = CNT_CONFIG,
+		.end   = CNT_CONFIG + 0xff,
+		.flags = IORESOURCE_MEM,
+	},
+	{
 		.start = IRQ_CNT,
 		.end = IRQ_CNT,
 		.flags = IORESOURCE_IRQ,
drivers/input/misc/bfin_rotary.c +43 -19

142 lines not on this page · raw message

Signature · 1 line
1.7.9.5