From: Tony Lindgren <tony@atomide.com>
To: Andrew de Quincey <adq_dvb@lidskialf.net>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
linux-arm-kernel@lists.arm.linux.org.uk,
Imre Deak <imre.deak@nokia.com>,
linux-omap@vger.kernel.org,
linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH 05/10] ARM: OMAP1: Make 770 LCD work, v3
Date: Thu, 28 May 2009 14:03:04 -0700 [thread overview]
Message-ID: <20090528210303.GI32453@atomide.com> (raw)
In-Reply-To: <20090528191138.GG32453@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]
* Tony Lindgren <tony@atomide.com> [090528 12:12]:
> * Andrew de Quincey <adq_dvb@lidskialf.net> [090528 11:44]:
> > Quoting Tony Lindgren <tony@atomide.com>:
> >
> >> * Andrew de Quincey <adq_dvb@lidskialf.net> [090525 09:41]:
> >>> Quoting Andrew de Quincey <adq_dvb@lidskialf.net>:
> >>>
> >>>> Quoting Russell King - ARM Linux <linux@arm.linux.org.uk>:
> >>>>
> >>>>> On Tue, May 19, 2009 at 04:37:32PM -0700, Tony Lindgren wrote:
> >>>>>> Make 770 LCD work by passing the clock from platform data.
> >>>>>> Also remove the old unused functions.
> >>>>>
> >>>>> I don't like this - because its passing struct clk's through platform
> >>>>> data. That's not how things are supposed to work.
> >>>>>
> >>>>> The way PXA solves this problem is to have clock aliases - see
> >>>>> clk_add_alias().
> >>>>
> >>>> Interesting idea - I now have a prototype patch implementing this,
> >>>> which I'll send when I get home (otherwise it would be an "it
> >>>> compiles" "test" :)
> >>>>
> >>>> There isn't a common definition of clk_add_alias() though - that
> >>>> symbol is defined in arch/arm/mach-pxa/clock.c, so I had to copy it
> >>>> into arch/arm/plat-omap/clock.c
> >>>
> >>> Attached is a patch implementing this method. I don't like the
> >>> duplication of the clk_alias code, but I imagine that could be resolved
> >>> if this method was chosen....
> >>
> >> Andrew, can you please reply with your Signed-off-by?
> >
> > Sure - sorry I was holding off in case there were any comments on the
> > method...
>
> I added a note about maybe moving the clk_add_alias() to
> arch/arm/common/clkdev.c later.
>
> Also noticed there were some whitespace errors, updated version below.
One more time with clk_add_alias() in a separate patch.
Tony
[-- Attachment #2: n770-clk-alias-v3.patch --]
[-- Type: text/x-diff, Size: 4728 bytes --]
From b2b1702dccf8ab070ecf3fdb59c77c552bbc103f Mon Sep 17 00:00:00 2001
From: Andrew de Quincey <adq_dvb@lidskialf.net>
Date: Thu, 28 May 2009 13:47:48 -0700
Subject: [PATCH] ARM: OMAP1: Make 770 LCD work
Make 770 LCD work by adding clk_add_alias().
Also remove the old unused functions.
Note that the clk_add_alias() could probably be moved
to arch/arm/clkdev.c later on.
Cc: linux-fbdev-devel@lists.sourceforge.net
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 8780ca6..e70fc7c 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -33,9 +33,11 @@
#include <mach/common.h>
#include <mach/dsp_common.h>
#include <mach/omapfb.h>
+#include <mach/hwa742.h>
#include <mach/lcd_mipid.h>
#include <mach/mmc.h>
#include <mach/usb.h>
+#include <mach/clock.h>
#define ADS7846_PENDOWN_GPIO 15
@@ -163,6 +165,15 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = {
},
};
+static struct hwa742_platform_data nokia770_hwa742_platform_data = {
+ .te_connected = 1,
+};
+
+static void hwa742_dev_init(void)
+{
+ clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL);
+ omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data);
+}
/* assume no Mini-AB port */
@@ -371,6 +382,7 @@ static void __init omap_nokia770_init(void)
omap_serial_init();
omap_register_i2c_bus(1, 100, NULL, 0);
omap_dsp_init();
+ hwa742_dev_init();
ads7846_dev_init();
mipid_dev_init();
omap_usb_init(&nokia770_usb_config);
diff --git a/arch/arm/plat-omap/include/mach/hwa742.h b/arch/arm/plat-omap/include/mach/hwa742.h
index 577f492..886248d 100644
--- a/arch/arm/plat-omap/include/mach/hwa742.h
+++ b/arch/arm/plat-omap/include/mach/hwa742.h
@@ -2,10 +2,6 @@
#define _HWA742_H
struct hwa742_platform_data {
- void (*power_up)(struct device *dev);
- void (*power_down)(struct device *dev);
- unsigned long (*get_clock_rate)(struct device *dev);
-
unsigned te_connected:1;
};
diff --git a/drivers/video/omap/hwa742.c b/drivers/video/omap/hwa742.c
index 8aa6e47..5d4f348 100644
--- a/drivers/video/omap/hwa742.c
+++ b/drivers/video/omap/hwa742.c
@@ -133,8 +133,7 @@ struct {
struct lcd_ctrl_extif *extif;
struct lcd_ctrl *int_ctrl;
- void (*power_up)(struct device *dev);
- void (*power_down)(struct device *dev);
+ struct clk *sys_ck;
} hwa742;
struct lcd_ctrl hwa742_ctrl;
@@ -915,14 +914,13 @@ static void hwa742_suspend(void)
hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED);
/* Enable sleep mode */
hwa742_write_reg(HWA742_POWER_SAVE, 1 << 1);
- if (hwa742.power_down != NULL)
- hwa742.power_down(hwa742.fbdev->dev);
+ clk_disable(hwa742.sys_ck);
}
static void hwa742_resume(void)
{
- if (hwa742.power_up != NULL)
- hwa742.power_up(hwa742.fbdev->dev);
+ clk_enable(hwa742.sys_ck);
+
/* Disable sleep mode */
hwa742_write_reg(HWA742_POWER_SAVE, 0);
while (1) {
@@ -955,14 +953,13 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
omapfb_conf = fbdev->dev->platform_data;
ctrl_conf = omapfb_conf->ctrl_platform_data;
- if (ctrl_conf == NULL || ctrl_conf->get_clock_rate == NULL) {
+ if (ctrl_conf == NULL) {
dev_err(fbdev->dev, "HWA742: missing platform data\n");
r = -ENOENT;
goto err1;
}
- hwa742.power_down = ctrl_conf->power_down;
- hwa742.power_up = ctrl_conf->power_up;
+ hwa742.sys_ck = clk_get(NULL, "hwa_sys_ck");
spin_lock_init(&hwa742.req_lock);
@@ -972,12 +969,11 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
if ((r = hwa742.extif->init(fbdev)) < 0)
goto err2;
- ext_clk = ctrl_conf->get_clock_rate(fbdev->dev);
+ ext_clk = clk_get_rate(hwa742.sys_ck);
if ((r = calc_extif_timings(ext_clk, &extif_mem_div)) < 0)
goto err3;
hwa742.extif->set_timings(&hwa742.reg_timings);
- if (hwa742.power_up != NULL)
- hwa742.power_up(fbdev->dev);
+ clk_enable(hwa742.sys_ck);
calc_hwa742_clk_rates(ext_clk, &sys_clk, &pix_clk);
if ((r = calc_extif_timings(sys_clk, &extif_mem_div)) < 0)
@@ -1040,8 +1036,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
return 0;
err4:
- if (hwa742.power_down != NULL)
- hwa742.power_down(fbdev->dev);
+ clk_disable(hwa742.sys_ck);
err3:
hwa742.extif->cleanup();
err2:
@@ -1055,8 +1050,7 @@ static void hwa742_cleanup(void)
hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED);
hwa742.extif->cleanup();
hwa742.int_ctrl->cleanup();
- if (hwa742.power_down != NULL)
- hwa742.power_down(hwa742.fbdev->dev);
+ clk_disable(hwa742.sys_ck);
}
struct lcd_ctrl hwa742_ctrl = {
WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com>
To: Andrew de Quincey <adq_dvb@lidskialf.net>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
linux-arm-kernel@lists.arm.linux.org.uk,
Imre Deak <imre.deak@nokia.com>,
linux-omap@vger.kernel.org,
linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH 05/10] ARM: OMAP1: Make 770 LCD work, v3
Date: Thu, 28 May 2009 14:03:04 -0700 [thread overview]
Message-ID: <20090528210303.GI32453@atomide.com> (raw)
In-Reply-To: <20090528191138.GG32453@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]
* Tony Lindgren <tony@atomide.com> [090528 12:12]:
> * Andrew de Quincey <adq_dvb@lidskialf.net> [090528 11:44]:
> > Quoting Tony Lindgren <tony@atomide.com>:
> >
> >> * Andrew de Quincey <adq_dvb@lidskialf.net> [090525 09:41]:
> >>> Quoting Andrew de Quincey <adq_dvb@lidskialf.net>:
> >>>
> >>>> Quoting Russell King - ARM Linux <linux@arm.linux.org.uk>:
> >>>>
> >>>>> On Tue, May 19, 2009 at 04:37:32PM -0700, Tony Lindgren wrote:
> >>>>>> Make 770 LCD work by passing the clock from platform data.
> >>>>>> Also remove the old unused functions.
> >>>>>
> >>>>> I don't like this - because its passing struct clk's through platform
> >>>>> data. That's not how things are supposed to work.
> >>>>>
> >>>>> The way PXA solves this problem is to have clock aliases - see
> >>>>> clk_add_alias().
> >>>>
> >>>> Interesting idea - I now have a prototype patch implementing this,
> >>>> which I'll send when I get home (otherwise it would be an "it
> >>>> compiles" "test" :)
> >>>>
> >>>> There isn't a common definition of clk_add_alias() though - that
> >>>> symbol is defined in arch/arm/mach-pxa/clock.c, so I had to copy it
> >>>> into arch/arm/plat-omap/clock.c
> >>>
> >>> Attached is a patch implementing this method. I don't like the
> >>> duplication of the clk_alias code, but I imagine that could be resolved
> >>> if this method was chosen....
> >>
> >> Andrew, can you please reply with your Signed-off-by?
> >
> > Sure - sorry I was holding off in case there were any comments on the
> > method...
>
> I added a note about maybe moving the clk_add_alias() to
> arch/arm/common/clkdev.c later.
>
> Also noticed there were some whitespace errors, updated version below.
One more time with clk_add_alias() in a separate patch.
Tony
[-- Attachment #2: n770-clk-alias-v3.patch --]
[-- Type: text/x-diff, Size: 4729 bytes --]
>From b2b1702dccf8ab070ecf3fdb59c77c552bbc103f Mon Sep 17 00:00:00 2001
From: Andrew de Quincey <adq_dvb@lidskialf.net>
Date: Thu, 28 May 2009 13:47:48 -0700
Subject: [PATCH] ARM: OMAP1: Make 770 LCD work
Make 770 LCD work by adding clk_add_alias().
Also remove the old unused functions.
Note that the clk_add_alias() could probably be moved
to arch/arm/clkdev.c later on.
Cc: linux-fbdev-devel@lists.sourceforge.net
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 8780ca6..e70fc7c 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -33,9 +33,11 @@
#include <mach/common.h>
#include <mach/dsp_common.h>
#include <mach/omapfb.h>
+#include <mach/hwa742.h>
#include <mach/lcd_mipid.h>
#include <mach/mmc.h>
#include <mach/usb.h>
+#include <mach/clock.h>
#define ADS7846_PENDOWN_GPIO 15
@@ -163,6 +165,15 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = {
},
};
+static struct hwa742_platform_data nokia770_hwa742_platform_data = {
+ .te_connected = 1,
+};
+
+static void hwa742_dev_init(void)
+{
+ clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL);
+ omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data);
+}
/* assume no Mini-AB port */
@@ -371,6 +382,7 @@ static void __init omap_nokia770_init(void)
omap_serial_init();
omap_register_i2c_bus(1, 100, NULL, 0);
omap_dsp_init();
+ hwa742_dev_init();
ads7846_dev_init();
mipid_dev_init();
omap_usb_init(&nokia770_usb_config);
diff --git a/arch/arm/plat-omap/include/mach/hwa742.h b/arch/arm/plat-omap/include/mach/hwa742.h
index 577f492..886248d 100644
--- a/arch/arm/plat-omap/include/mach/hwa742.h
+++ b/arch/arm/plat-omap/include/mach/hwa742.h
@@ -2,10 +2,6 @@
#define _HWA742_H
struct hwa742_platform_data {
- void (*power_up)(struct device *dev);
- void (*power_down)(struct device *dev);
- unsigned long (*get_clock_rate)(struct device *dev);
-
unsigned te_connected:1;
};
diff --git a/drivers/video/omap/hwa742.c b/drivers/video/omap/hwa742.c
index 8aa6e47..5d4f348 100644
--- a/drivers/video/omap/hwa742.c
+++ b/drivers/video/omap/hwa742.c
@@ -133,8 +133,7 @@ struct {
struct lcd_ctrl_extif *extif;
struct lcd_ctrl *int_ctrl;
- void (*power_up)(struct device *dev);
- void (*power_down)(struct device *dev);
+ struct clk *sys_ck;
} hwa742;
struct lcd_ctrl hwa742_ctrl;
@@ -915,14 +914,13 @@ static void hwa742_suspend(void)
hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED);
/* Enable sleep mode */
hwa742_write_reg(HWA742_POWER_SAVE, 1 << 1);
- if (hwa742.power_down != NULL)
- hwa742.power_down(hwa742.fbdev->dev);
+ clk_disable(hwa742.sys_ck);
}
static void hwa742_resume(void)
{
- if (hwa742.power_up != NULL)
- hwa742.power_up(hwa742.fbdev->dev);
+ clk_enable(hwa742.sys_ck);
+
/* Disable sleep mode */
hwa742_write_reg(HWA742_POWER_SAVE, 0);
while (1) {
@@ -955,14 +953,13 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
omapfb_conf = fbdev->dev->platform_data;
ctrl_conf = omapfb_conf->ctrl_platform_data;
- if (ctrl_conf == NULL || ctrl_conf->get_clock_rate == NULL) {
+ if (ctrl_conf == NULL) {
dev_err(fbdev->dev, "HWA742: missing platform data\n");
r = -ENOENT;
goto err1;
}
- hwa742.power_down = ctrl_conf->power_down;
- hwa742.power_up = ctrl_conf->power_up;
+ hwa742.sys_ck = clk_get(NULL, "hwa_sys_ck");
spin_lock_init(&hwa742.req_lock);
@@ -972,12 +969,11 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
if ((r = hwa742.extif->init(fbdev)) < 0)
goto err2;
- ext_clk = ctrl_conf->get_clock_rate(fbdev->dev);
+ ext_clk = clk_get_rate(hwa742.sys_ck);
if ((r = calc_extif_timings(ext_clk, &extif_mem_div)) < 0)
goto err3;
hwa742.extif->set_timings(&hwa742.reg_timings);
- if (hwa742.power_up != NULL)
- hwa742.power_up(fbdev->dev);
+ clk_enable(hwa742.sys_ck);
calc_hwa742_clk_rates(ext_clk, &sys_clk, &pix_clk);
if ((r = calc_extif_timings(sys_clk, &extif_mem_div)) < 0)
@@ -1040,8 +1036,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
return 0;
err4:
- if (hwa742.power_down != NULL)
- hwa742.power_down(fbdev->dev);
+ clk_disable(hwa742.sys_ck);
err3:
hwa742.extif->cleanup();
err2:
@@ -1055,8 +1050,7 @@ static void hwa742_cleanup(void)
hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED);
hwa742.extif->cleanup();
hwa742.int_ctrl->cleanup();
- if (hwa742.power_down != NULL)
- hwa742.power_down(hwa742.fbdev->dev);
+ clk_disable(hwa742.sys_ck);
}
struct lcd_ctrl hwa742_ctrl = {
next prev parent reply other threads:[~2009-05-28 21:03 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-19 23:30 [PATCH 00/10] Omap updates for merge window after 2.6.30 Tony Lindgren
2009-05-19 23:32 ` [PATCH 01/10] ARM: OMAP: Increase VMALLOC_END to allow 256MB RAM Tony Lindgren
2009-05-19 23:33 ` [PATCH 02/10] ARM: OMAP: McBSP: Fix legacy interrupts to clear their status Tony Lindgren
2009-05-19 23:34 ` [PATCH 03/10] ARM: OMAP: Update contact address of I2C registration helper Tony Lindgren
2009-05-25 9:23 ` Russell King - ARM Linux
2009-05-25 11:32 ` Jarkko Nikula
2009-05-25 16:23 ` Tony Lindgren
2009-05-19 23:36 ` [PATCH 04/10] ARM: OMAP1: Misc clean-up Tony Lindgren
2009-05-19 23:37 ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work Tony Lindgren
2009-05-25 9:29 ` Russell King - ARM Linux
2009-05-25 13:21 ` Andrew de Quincey
2009-05-25 16:40 ` Andrew de Quincey
2009-05-28 18:20 ` Tony Lindgren
2009-05-28 18:44 ` Andrew de Quincey
2009-05-28 19:11 ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work, v2 Tony Lindgren
2009-05-28 19:11 ` Tony Lindgren
2009-05-28 21:03 ` Tony Lindgren [this message]
2009-05-28 21:03 ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work, v3 Tony Lindgren
2009-05-28 19:50 ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work Russell King - ARM Linux
2009-05-29 0:29 ` Andrew de Quincey
2009-06-01 13:57 ` Kalle Valo
2009-05-28 19:53 ` Russell King - ARM Linux
2009-05-28 21:02 ` [PATCH] ARM: Move clk_add_alias() to arch/arm/common/clkdev.c (Re: [PATCH 05/10] ARM: OMAP1: Make 770 LCD work) Tony Lindgren
2009-05-28 21:02 ` Tony Lindgren
2009-06-03 16:44 ` Tony Lindgren
2009-05-19 23:38 ` [PATCH 06/10] ARM: OMAP2/3: DMA: implement trans copy and const fill Tony Lindgren
2009-05-19 23:40 ` [PATCH 07/10] ARM: OMAP2/3: sDMA: Correct omap_request_dma_chain() Tony Lindgren
2009-05-25 9:34 ` Russell King - ARM Linux
2009-05-25 9:40 ` Shilimkar, Santosh
2009-05-25 16:28 ` [PATCH 07/10] ARM: OMAP2/3: sDMA: Correct omap_request_dma_chain(), v2 Tony Lindgren
2009-05-26 4:55 ` Shilimkar, Santosh
2009-05-19 23:41 ` [PATCH 08/10] ARM: OMAP2/3: Add generic onenand support when connected to GPMC Tony Lindgren
2009-05-25 9:43 ` Russell King - ARM Linux
2009-05-25 16:50 ` [PATCH 08/10] ARM: OMAP2/3: Add generic onenand support when connected to GPMC, v2 Tony Lindgren
2009-05-19 23:42 ` [PATCH 09/10] ARM: OMAP2/3: Add generic smc91x support when connected to GPMC Tony Lindgren
2009-05-25 9:46 ` Russell King - ARM Linux
2009-05-25 16:59 ` [PATCH 09/10] ARM: OMAP2/3: Add generic smc91x support when connected to GPMC, v2 Tony Lindgren
2009-05-19 23:44 ` [PATCH 10/10] ARM: OMAP2: 2430SDP: Add FB support to board file Tony Lindgren
2009-05-25 17:42 ` [PATCH 11/10] ARM: OMAP: Add some entries to MAINTAINERS Tony Lindgren
2009-05-25 17:42 ` Tony Lindgren
2009-05-26 23:18 ` [PATCH 00/10] Omap updates for merge window after 2.6.30 Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090528210303.GI32453@atomide.com \
--to=tony@atomide.com \
--cc=adq_dvb@lidskialf.net \
--cc=imre.deak@nokia.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.