Skip to contentSkip to conversation

msm: trout: add gpio_to_irq

PATCH New Daniel Walker 1 participant 5 messages Dec 13, 2010

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

PATCH v2 1/5 msm: trout: add gpio_to_irq

trout has gpiolib support and interrupt support, but was missing the gpio_to_irq function. This adds that functions which should allow proper translation.

---
 arch/arm/mach-msm/board-trout-gpio.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-msm/board-trout-gpio.c +8 -0
index c50f3af..f8c09ef 100644
@@ -72,6 +72,13 @@ static int msm_gpiolib_direction_output(struct gpio_chip *chip,
 	return 0;
 }
 
+static int trout_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+	struct msm_gpio_chip *msm_gpio = to_msm_gpio_chip(chip);
+
+	return TROUT_GPIO_TO_INT(offset + chip->base);
+}
+
 #define TROUT_GPIO_BANK(name, reg_num, base_gpio, shadow_val)		\
 	{								\
 		.chip = {						\
@@ -80,6 +87,7 @@ static int msm_gpiolib_direction_output(struct gpio_chip *chip,
 			.direction_output = msm_gpiolib_direction_output, \
 			.get		  = msm_gpiolib_get,		\
 			.set		  = msm_gpiolib_set,		\
+			.to_irq		  = trout_gpio_to_irq,		\
 			.base		  = base_gpio,			\
 			.ngpio		  = 8,				\
 		},							\
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 2/5 msm: add CLK_MINMAX to pmdh_clk

This adds in the CLK_MINMAX flag to the pmdh_clk since it's actual a min/max clock instead of a single frequency clock.

---
 arch/arm/mach-msm/devices-msm7x00.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-msm/devices-msm7x00.c +1 -1
index 4e8c0bc..3bf8cb5 100644
@@ -364,7 +364,7 @@ struct clk msm_clocks_7x01a[] = {
 	CLK_PCOM("mdp_clk",	MDP_CLK,	NULL, OFF),
 	CLK_PCOM("pbus_clk",	PBUS_CLK,	NULL, 0),
 	CLK_PCOM("pcm_clk",	PCM_CLK,	NULL, 0),
-	CLK_PCOM("pmdh_clk",	PMDH_CLK,	NULL, OFF ),
+	CLK_PCOM("pmdh_clk",	PMDH_CLK,	NULL, OFF | CLK_MINMAX),
 	CLK_PCOM("sdac_clk",	SDAC_CLK,	NULL, OFF),
 	CLK_PCOM("sdc_clk",	SDC1_CLK,	&msm_device_sdc1.dev, OFF),
 	CLK_PCOM("sdc_pclk",	SDC1_P_CLK,	&msm_device_sdc1.dev, OFF),
Signature · 1 line
1.7.1
#2 lore raw

PATCH v2 3/5 msm: trout: change name of pmdh_clk to mddi_clk

In reply to Daniel Walker

This clock is used in the framebuffer driver as mddi_clk. This just changes the name to match that. This also mirrors a change in Google tree.

---
 arch/arm/mach-msm/devices-msm7x00.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-msm/devices-msm7x00.c +1 -1
index 3bf8cb5..b00a94b 100644
@@ -364,7 +364,7 @@ struct clk msm_clocks_7x01a[] = {
 	CLK_PCOM("mdp_clk",	MDP_CLK,	NULL, OFF),
 	CLK_PCOM("pbus_clk",	PBUS_CLK,	NULL, 0),
 	CLK_PCOM("pcm_clk",	PCM_CLK,	NULL, 0),
-	CLK_PCOM("pmdh_clk",	PMDH_CLK,	NULL, OFF | CLK_MINMAX),
+	CLK_PCOM("mddi_clk",	PMDH_CLK,	NULL, OFF | CLK_MINMAX),
 	CLK_PCOM("sdac_clk",	SDAC_CLK,	NULL, OFF),
 	CLK_PCOM("sdc_clk",	SDC1_CLK,	&msm_device_sdc1.dev, OFF),
 	CLK_PCOM("sdc_pclk",	SDC1_P_CLK,	&msm_device_sdc1.dev, OFF),
Signature · 1 line
1.7.1
#3 lore raw

PATCH v2 4/5 msm: add handling for clocks tagged as CLK_MINMAX

In reply to Daniel Walker

CLK_MINMAX is used to denote clocks that have a wide variation in possible frequencies. This handling just sets the min and max values to the same value.

This code was original created by Saravana Kannan.

Cc Saravana Kannan <[email protected]>
---
 arch/arm/mach-msm/clock.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
arch/arm/mach-msm/clock.c +15 -0
index c57210f..2069bfa 100644
@@ -120,6 +120,21 @@ EXPORT_SYMBOL(clk_get_rate);
 
 int clk_set_rate(struct clk *clk, unsigned long rate)
 {
+	int ret;
+	if (clk->flags & CLKFLAG_MAX) {
+		ret = clk->ops->set_max_rate(clk->id, rate);
+		if (ret)
+			return ret;
+	}
+	if (clk->flags & CLKFLAG_MIN) {
+		ret = clk->ops->set_min_rate(clk->id, rate);
+		if (ret)
+			return ret;
+	}
+
+	if (clk->flags & CLKFLAG_MAX || clk->flags & CLKFLAG_MIN)
+		return ret;
+
 	return clk->ops->set_rate(clk->id, rate);
 }
 EXPORT_SYMBOL(clk_set_rate);
Signature · 1 line
1.7.1
#4 lore raw

PATCH v2 5/5 msm: initial framebuffer support

In reply to Daniel Walker

Initial framebuffer components. Add board-trout-panel.c as well as platform parts to enable the framebuffer. This code comes directly from Google's tree.

---
 arch/arm/mach-msm/Makefile            |    1 +
 arch/arm/mach-msm/board-trout-panel.c |  297 +++++++++++++++++++++++++++++++++
 arch/arm/mach-msm/devices-msm7x00.c   |   67 ++++++++
 arch/arm/mach-msm/devices.h           |    4 +
 4 files changed, 369 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-msm/board-trout-panel.c
arch/arm/mach-msm/Makefile +1 -0
index b5a7b07..3abe889 100644
@@ -20,6 +20,7 @@ obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o
 obj-$(CONFIG_MSM_SMD) += last_radio_log.o
 
 obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o
+obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o
 obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o
 obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o
 obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o
arch/arm/mach-msm/board-trout-panel.c new file +297 -0

297 lines not on this page · raw message

arch/arm/mach-msm/devices-msm7x00.c +67 -0

73 lines not on this page · raw message

arch/arm/mach-msm/devices.h +4 -0
index 568443e..68b8075 100644
@@ -35,6 +35,10 @@ extern struct platform_device msm_device_smd;
 
 extern struct platform_device msm_device_nand;
 
+extern struct platform_device msm_device_mddi0;
+extern struct platform_device msm_device_mddi1;
+extern struct platform_device msm_device_mdp;
+
 extern struct clk msm_clocks_7x01a[];
 extern unsigned msm_num_clocks_7x01a;
 
Signature · 1 line
1.7.1