Skip to contentSkip to conversation

msm: fb: initial framebuffer support

PATCH In review Daniel Walker 2 participants 9 messages Jul 27, 2010 – Jul 28, 2010

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

PATCH 1/7 msm: fb: initial framebuffer support

Initial framebuffer components. Add board-trout-panel.c as well as platform parts.

---
 arch/arm/mach-msm/Makefile            |    1 +
 arch/arm/mach-msm/board-trout-panel.c |  633 +++++++++++++++++++++++++++++++++
 arch/arm/mach-msm/devices-msm7x00.c   |   67 ++++
 arch/arm/mach-msm/devices.h           |    4 +
 4 files changed, 705 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-msm/board-trout-panel.c
arch/arm/mach-msm/Makefile +1 -0
index df7bf97..cdd1caf 100644
@@ -16,6 +16,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 +633 -0

633 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 fd71edc..7291e3e 100644
@@ -37,6 +37,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 · 5 lines
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#1 lore raw

PATCH 2/7 msm: gpio support for trout.

This adds the tables required to enable gpiolib support in trout.

---
 arch/arm/mach-msm/board-trout.c     |    6 ++++++
 arch/arm/mach-msm/devices-msm7x00.c |   18 ++++++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
arch/arm/mach-msm/board-trout.c +6 -0
index 8f1b28f..b370124 100644
@@ -33,6 +33,12 @@
 extern int trout_init_mmc(unsigned int);
 
 static struct platform_device *devices[] __initdata = {
+	&msm_gpio_devices[0],
+	&msm_gpio_devices[1],
+	&msm_gpio_devices[2],
+	&msm_gpio_devices[3],
+	&msm_gpio_devices[4],
+	&msm_gpio_devices[5],
 	&msm_device_uart3,
 	&msm_device_smd,
 	&msm_device_nand,
arch/arm/mach-msm/devices-msm7x00.c +18 -0
index c782f72..a084d14 100644
@@ -413,6 +413,24 @@ struct platform_device msm_device_mdp = {
 	.resource = resources_mdp,
 };
 
+static struct msm7200a_gpio_platform_data gpio_platform_data[] = {
+	MSM7200A_GPIO_PLATFORM_DATA(0,   0,  15, INT_GPIO_GROUP1),
+	MSM7200A_GPIO_PLATFORM_DATA(1,  16,  42, INT_GPIO_GROUP2),
+	MSM7200A_GPIO_PLATFORM_DATA(2,  43,  67, INT_GPIO_GROUP1),
+	MSM7200A_GPIO_PLATFORM_DATA(3,  68,  94, INT_GPIO_GROUP1),
+	MSM7200A_GPIO_PLATFORM_DATA(4,  95, 106, INT_GPIO_GROUP1),
+	MSM7200A_GPIO_PLATFORM_DATA(5, 107, 121, INT_GPIO_GROUP1),
+};
+
+struct platform_device msm_gpio_devices[] = {
+	MSM7200A_GPIO_DEVICE(0, gpio_platform_data),
+	MSM7200A_GPIO_DEVICE(1, gpio_platform_data),
+	MSM7200A_GPIO_DEVICE(2, gpio_platform_data),
+	MSM7200A_GPIO_DEVICE(3, gpio_platform_data),
+	MSM7200A_GPIO_DEVICE(4, gpio_platform_data),
+	MSM7200A_GPIO_DEVICE(5, gpio_platform_data),
+};
+
 struct clk msm_clocks_7x01a[] = {
 	CLK_PCOM("adm_clk",	ADM_CLK,	NULL, 0),
 	CLK_PCOM("adsp_clk",	ADSP_CLK,	NULL, 0),
Signature · 5 lines
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#2 lore raw

PATCH 3/7 msm: update clk rate to use min/max values

In reply to Daniel Walker

Some clocks are set with a min and max values as opposed to one set value. I've added this as a setting for the MSM framebuffer driver and updated the platform data.

---
 arch/arm/mach-msm/board-trout-panel.c   |    3 ++-
 arch/arm/mach-msm/include/mach/msm_fb.h |    3 ++-
 drivers/video/msm/mddi.c                |   12 +++++++++---
 3 files changed, 13 insertions(+), 5 deletions(-)
arch/arm/mach-msm/board-trout-panel.c +2 -1
index 0fa5a35..8f07b8c 100644
@@ -565,7 +565,8 @@ struct msm_mddi_bridge_platform_data toshiba_client_data = {
 };
 
 static struct msm_mddi_platform_data mddi_pdata = {
-	.clk_rate = 122880000,
+	.min_clk_rate = 122880000,
+	.min_clk_rate = 98304000,
 	.power_client = trout_mddi_power_client,
 	.fb_resource = resources_msm_fb,
 	.num_clients = 1,
arch/arm/mach-msm/include/mach/msm_fb.h +2 -1
index 1f4fc81..9d15d7a 100644
@@ -79,7 +79,8 @@ struct msm_mddi_client_data {
 };
 
 struct msm_mddi_platform_data {
-	unsigned int clk_rate;
+	unsigned int max_clk_rate;
+	unsigned int min_clk_rate;
 	void (*power_client)(struct msm_mddi_client_data *, int on);
 
 	/* fixup the mfr name, product id */
drivers/video/msm/mddi.c +9 -3
index 844eff3..1192365 100644
@@ -30,6 +30,8 @@
 #include <mach/irqs.h>
 #include <mach/board.h>
 #include <mach/msm_fb.h>
+#include <mach/clk.h>
+
 #include "mddi_hw.h"
 
 #define FLAG_DISABLE_HIBERNATION 0x0001
@@ -625,7 +627,8 @@ static struct mddi_info mddi_info[2];
 
 static int __init mddi_clk_setup(struct platform_device *pdev,
 				 struct mddi_info *mddi,
-				 unsigned long clk_rate)
+				 unsigned long max_clk_rate,
+				 unsigned long min_clk_rate)
 {
 	int ret;
 
@@ -638,7 +641,10 @@ static int __init mddi_clk_setup(struct platform_device *pdev,
 	ret =  clk_enable(mddi->clk);
 	if (ret)
 		goto fail;
-	ret = clk_set_rate(mddi->clk, clk_rate);
+	ret = clk_set_max_rate(mddi->clk, max_clk_rate);
+	if (ret)
+		goto fail;
+	ret = clk_set_min_rate(mddi->clk, min_clk_rate);
 	if (ret)
 		goto fail;
 	return 0;
@@ -702,7 +708,7 @@ static int __init mddi_probe(struct platform_device *pdev)
 	spin_lock_init(&mddi->int_lock);
 	init_waitqueue_head(&mddi->int_wait);
 
-	ret = mddi_clk_setup(pdev, mddi, pdata->clk_rate);
+	ret = mddi_clk_setup(pdev, mddi, pdata->max_clk_rate, pdata->min_clk_rate);
 	if (ret) {
 		printk(KERN_ERR "mddi: failed to setup clock!\n");
 		goto error_clk_setup;
Signature · 5 lines
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#5 lore raw

PATCH 4/7 msm: add CLK_MINMAX to pmdh_clk

In reply to Daniel Walker

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 a084d14..62a06fa 100644
@@ -448,7 +448,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 · 5 lines
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#6 lore raw

PATCH 5/7 drivers: video: msm: fix hang on disable_irq

In reply to Daniel Walker

There's a resource race around disable_irq. Using the nosync version allows the function to continue and prevents the hang.

Adapted from Arve Hjønnevåg <[email protected]> changes in the Google tree.

---
 drivers/video/msm/mdp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/msm/mdp.c +1 -1
index 3c28db0..2b5bf79 100644
@@ -90,7 +90,7 @@ static int locked_disable_mdp_irq(struct mdp_info *mdp, uint32_t mask)
 	mdp_irq_mask &= ~(mask);
 	/* if no one is waiting on the interrupt, disable it */
 	if (!mdp_irq_mask) {
-		disable_irq(mdp->irq);
+		disable_irq_nosync(mdp->irq);
 		if (clk)
 			clk_disable(clk);
 	}
Signature · 5 lines
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#7 lore raw

PATCH 6/7 drivers: msm: video: add dev_set_name call

In reply to Daniel Walker

This is required before the driver can successfully be registered.

Adapted from Arve Hjønnevåg <[email protected]> changes in the Google tree.

---
 drivers/video/msm/mdp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/video/msm/mdp.c +1 -0
index 2b5bf79..c3636d5 100644
@@ -482,6 +482,7 @@ int mdp_probe(struct platform_device *pdev)
 	/* register mdp device */
 	mdp->mdp_dev.dev.parent = &pdev->dev;
 	mdp->mdp_dev.dev.class = mdp_class;
+	dev_set_name(&mdp->mdp_dev.dev, "mdp%d", pdev->id);
 
 	/* if you can remove the platform device you'd have to implement
 	 * this:
Signature · 5 lines
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#8 lore raw

PATCH 7/7 driver: video: msm: change mddi clock name to pmdh_clk

In reply to Daniel Walker

Update this driver to reflect clock name changes in the base architecture code.

---
 drivers/video/msm/mddi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/msm/mddi.c +1 -1
index 1192365..4e2b951 100644
@@ -633,7 +633,7 @@ static int __init mddi_clk_setup(struct platform_device *pdev,
 	int ret;
 
 	/* set up the clocks */
-	mddi->clk = clk_get(&pdev->dev, "mddi_clk");
+	mddi->clk = clk_get(&pdev->dev, "pmdh_clk");
 	if (IS_ERR(mddi->clk)) {
 		printk(KERN_INFO "mddi: failed to get clock\n");
 		return PTR_ERR(mddi->clk);
Signature · 5 lines
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#3 lore raw

Re: [PATCH 3/7] msm: update clk rate to use min/max values

In reply to Daniel Walker

arch/arm/mach-msm/board-trout-panel.c struct msm_mddi_bridge_platform_data toshiba_client_data = { · line 569

Quoted 4 lines · Daniel Walker
  static struct msm_mddi_platform_data mddi_pdata = {
arch/arm/mach-msm/board-trout-panel.c +2 -1
-	.clk_rate = 122880000,
+	.min_clk_rate = 122880000,
+	.min_clk_rate = 98304000,

One of those should probably be max...

--
Neil

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#4 lore raw

Re: [PATCH 3/7] msm: update clk rate to use min/max values

Quoted 7 lines · Neil Leeder

arch/arm/mach-msm/board-trout-panel.c struct msm_mddi_bridge_platform_data toshiba_client_data = { · line 569

Quoted 4 lines · Daniel Walker
  static struct msm_mddi_platform_data mddi_pdata = {
arch/arm/mach-msm/board-trout-panel.c +2 -1
-	.clk_rate = 122880000,
+	.min_clk_rate = 122880000,
+	.min_clk_rate = 98304000,

One of those should probably be max...

Ooops, True .. What do you think of this patch in general ? How are we doing this in the staging driver?

Daniel

Signature · 2 lines
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.