public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] ARM: OMAP: Initialize MADC clock divider and clock
@ 2009-05-30 13:40 Steve Sakoman
  2009-05-30 13:45 ` Steve Sakoman
  2009-06-03 20:10 ` Steve Sakoman
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Sakoman @ 2009-05-30 13:40 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

Though the comment in clocks_init claims to initialize the MADC
clocks, it wasn't actually being done.  This patch implements minimal
MADC clock initialization.

Compile/run tested on Overo (prior to patch MADC access would always timeout)

diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
index 769b34b..c5ca36d 100644
--- a/drivers/mfd/twl4030-core.c
+++ b/drivers/mfd/twl4030-core.c
@@ -159,6 +159,7 @@

 /* Few power values */
 #define R_CFG_BOOT			0x05
+#define R_GPBR1				0x0C
 #define R_PROTECT_KEY			0x0E

 /* access control values for R_PROTECT_KEY */
@@ -166,6 +167,10 @@
 #define KEY_UNLOCK2			0xec
 #define KEY_LOCK			0x00

+/* MADC clock values for R_GPBR1 */
+#define MADC_HFCLK_EN			0x80
+#define DEFAULT_MADC_CLK_EN		0x10
+
 /* some fields in R_CFG_BOOT */
 #define HFCLK_FREQ_19p2_MHZ		(1 << 0)
 #define HFCLK_FREQ_26_MHZ		(2 << 0)
@@ -717,6 +722,11 @@ static void __init clocks_init(struct device *dev)
 	ctrl |= HIGH_PERF_SQ;
 	e |= unprotect_pm_master();
 	/* effect->MADC+USB ck en */
+
+	if (twl_has_madc())
+		e |= twl4030_i2c_write_u8(TWL4030_MODULE_INTBR,
+				MADC_HFCLK_EN | DEFAULT_MADC_CLK_EN, R_GPBR1);
+
 	e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, ctrl, R_CFG_BOOT);
 	e |= protect_pm_master();

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] ARM: OMAP: Initialize MADC clock divider and clock
  2009-05-30 13:40 [PATCH/RFC] ARM: OMAP: Initialize MADC clock divider and clock Steve Sakoman
@ 2009-05-30 13:45 ` Steve Sakoman
  2009-06-03 20:10 ` Steve Sakoman
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Sakoman @ 2009-05-30 13:45 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

Not enough coffee this morning!

After a comment period I will resubmit these two patches with proper
signed-off-by, etc.

Steve

On Sat, May 30, 2009 at 6:40 AM, Steve Sakoman <sakoman@gmail.com> wrote:
> Though the comment in clocks_init claims to initialize the MADC
> clocks, it wasn't actually being done.  This patch implements minimal
> MADC clock initialization.
>
> Compile/run tested on Overo (prior to patch MADC access would always timeout)
>
> diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
> index 769b34b..c5ca36d 100644
> --- a/drivers/mfd/twl4030-core.c
> +++ b/drivers/mfd/twl4030-core.c
> @@ -159,6 +159,7 @@
>
>  /* Few power values */
>  #define R_CFG_BOOT                     0x05
> +#define R_GPBR1                                0x0C
>  #define R_PROTECT_KEY                  0x0E
>
>  /* access control values for R_PROTECT_KEY */
> @@ -166,6 +167,10 @@
>  #define KEY_UNLOCK2                    0xec
>  #define KEY_LOCK                       0x00
>
> +/* MADC clock values for R_GPBR1 */
> +#define MADC_HFCLK_EN                  0x80
> +#define DEFAULT_MADC_CLK_EN            0x10
> +
>  /* some fields in R_CFG_BOOT */
>  #define HFCLK_FREQ_19p2_MHZ            (1 << 0)
>  #define HFCLK_FREQ_26_MHZ              (2 << 0)
> @@ -717,6 +722,11 @@ static void __init clocks_init(struct device *dev)
>        ctrl |= HIGH_PERF_SQ;
>        e |= unprotect_pm_master();
>        /* effect->MADC+USB ck en */
> +
> +       if (twl_has_madc())
> +               e |= twl4030_i2c_write_u8(TWL4030_MODULE_INTBR,
> +                               MADC_HFCLK_EN | DEFAULT_MADC_CLK_EN, R_GPBR1);
> +
>        e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, ctrl, R_CFG_BOOT);
>        e |= protect_pm_master();
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] ARM: OMAP: Initialize MADC clock divider and clock
  2009-05-30 13:40 [PATCH/RFC] ARM: OMAP: Initialize MADC clock divider and clock Steve Sakoman
  2009-05-30 13:45 ` Steve Sakoman
@ 2009-06-03 20:10 ` Steve Sakoman
  2009-06-03 20:28   ` Tony Lindgren
  1 sibling, 1 reply; 4+ messages in thread
From: Steve Sakoman @ 2009-06-03 20:10 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org, Tony Lindgren

Tony,

I noticed your comment requesting all twl4030 patches be submitted to
mainline.  I assume this patch falls into that category too?

Also for those listening in -- no comments on this patch yet!  Does
that mean it looks good?   ;-)

Steve

On Sat, May 30, 2009 at 6:40 AM, Steve Sakoman <sakoman@gmail.com> wrote:
> Though the comment in clocks_init claims to initialize the MADC
> clocks, it wasn't actually being done.  This patch implements minimal
> MADC clock initialization.
>
> Compile/run tested on Overo (prior to patch MADC access would always timeout)
>
> diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
> index 769b34b..c5ca36d 100644
> --- a/drivers/mfd/twl4030-core.c
> +++ b/drivers/mfd/twl4030-core.c
> @@ -159,6 +159,7 @@
>
>  /* Few power values */
>  #define R_CFG_BOOT                     0x05
> +#define R_GPBR1                                0x0C
>  #define R_PROTECT_KEY                  0x0E
>
>  /* access control values for R_PROTECT_KEY */
> @@ -166,6 +167,10 @@
>  #define KEY_UNLOCK2                    0xec
>  #define KEY_LOCK                       0x00
>
> +/* MADC clock values for R_GPBR1 */
> +#define MADC_HFCLK_EN                  0x80
> +#define DEFAULT_MADC_CLK_EN            0x10
> +
>  /* some fields in R_CFG_BOOT */
>  #define HFCLK_FREQ_19p2_MHZ            (1 << 0)
>  #define HFCLK_FREQ_26_MHZ              (2 << 0)
> @@ -717,6 +722,11 @@ static void __init clocks_init(struct device *dev)
>        ctrl |= HIGH_PERF_SQ;
>        e |= unprotect_pm_master();
>        /* effect->MADC+USB ck en */
> +
> +       if (twl_has_madc())
> +               e |= twl4030_i2c_write_u8(TWL4030_MODULE_INTBR,
> +                               MADC_HFCLK_EN | DEFAULT_MADC_CLK_EN, R_GPBR1);
> +
>        e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, ctrl, R_CFG_BOOT);
>        e |= protect_pm_master();
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] ARM: OMAP: Initialize MADC clock divider and clock
  2009-06-03 20:10 ` Steve Sakoman
@ 2009-06-03 20:28   ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2009-06-03 20:28 UTC (permalink / raw)
  To: Steve Sakoman; +Cc: linux-omap@vger.kernel.org

* Steve Sakoman <sakoman@gmail.com> [090603 13:10]:
> Tony,
> 
> I noticed your comment requesting all twl4030 patches be submitted to
> mainline.  I assume this patch falls into that category too?

Yeah, we should try to make all the patches against mainline now.
 
> Also for those listening in -- no comments on this patch yet!  Does
> that mean it looks good?   ;-)

You should send it to:

$ grep -a7 "MULTIFUNCTION DEVICES" MAINTAINERS
P:      Samuel Ortiz
M:      sameo@linux.intel.com
L:      linux-kernel@vger.kernel.org
T:      git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6.git
S:      Supported
F:      drivers/mfd/

Tony
 
> Steve
> 
> On Sat, May 30, 2009 at 6:40 AM, Steve Sakoman <sakoman@gmail.com> wrote:
> > Though the comment in clocks_init claims to initialize the MADC
> > clocks, it wasn't actually being done.  This patch implements minimal
> > MADC clock initialization.
> >
> > Compile/run tested on Overo (prior to patch MADC access would always timeout)
> >
> > diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
> > index 769b34b..c5ca36d 100644
> > --- a/drivers/mfd/twl4030-core.c
> > +++ b/drivers/mfd/twl4030-core.c
> > @@ -159,6 +159,7 @@
> >
> >  /* Few power values */
> >  #define R_CFG_BOOT                     0x05
> > +#define R_GPBR1                                0x0C
> >  #define R_PROTECT_KEY                  0x0E
> >
> >  /* access control values for R_PROTECT_KEY */
> > @@ -166,6 +167,10 @@
> >  #define KEY_UNLOCK2                    0xec
> >  #define KEY_LOCK                       0x00
> >
> > +/* MADC clock values for R_GPBR1 */
> > +#define MADC_HFCLK_EN                  0x80
> > +#define DEFAULT_MADC_CLK_EN            0x10
> > +
> >  /* some fields in R_CFG_BOOT */
> >  #define HFCLK_FREQ_19p2_MHZ            (1 << 0)
> >  #define HFCLK_FREQ_26_MHZ              (2 << 0)
> > @@ -717,6 +722,11 @@ static void __init clocks_init(struct device *dev)
> >        ctrl |= HIGH_PERF_SQ;
> >        e |= unprotect_pm_master();
> >        /* effect->MADC+USB ck en */
> > +
> > +       if (twl_has_madc())
> > +               e |= twl4030_i2c_write_u8(TWL4030_MODULE_INTBR,
> > +                               MADC_HFCLK_EN | DEFAULT_MADC_CLK_EN, R_GPBR1);
> > +
> >        e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, ctrl, R_CFG_BOOT);
> >        e |= protect_pm_master();
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-03 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-30 13:40 [PATCH/RFC] ARM: OMAP: Initialize MADC clock divider and clock Steve Sakoman
2009-05-30 13:45 ` Steve Sakoman
2009-06-03 20:10 ` Steve Sakoman
2009-06-03 20:28   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox