From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Tue, 15 Jul 2014 10:12:34 +0200 Subject: [U-Boot] [PATCH v2 3/5] i.MX6: define struct pwm_regs and PWMCR_* defines In-Reply-To: <1405138221-4721-4-git-send-email-hs@denx.de> References: <1405138221-4721-1-git-send-email-hs@denx.de> <1405138221-4721-4-git-send-email-hs@denx.de> Message-ID: <53C4E272.8010409@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Heiko, On 12/07/2014 06:10, Heiko Schocher wrote: > add defines for pwm modul found on imx6. > > Signed-off-by: Heiko Schocher > Cc: Stefano Babic > > --- > - changes for v2: > - new > > arch/arm/include/asm/arch-mx6/imx-regs.h | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h > index 7193118..2135051 100644 > --- a/arch/arm/include/asm/arch-mx6/imx-regs.h > +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h > @@ -669,5 +669,21 @@ struct wdog_regs { > u16 wmcr; /* Miscellaneous Control */ > }; > > +#define PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4) > +#define PWMCR_DOZEEN (1 << 24) > +#define PWMCR_WAITEN (1 << 23) > +#define PWMCR_DBGEN (1 << 22) > +#define PWMCR_CLKSRC_IPG_HIGH (2 << 16) > +#define PWMCR_CLKSRC_IPG (1 << 16) > +#define PWMCR_EN (1 << 0) > + > +struct pwm_regs { > + u32 cr; > + u32 sr; > + u32 ir; > + u32 sar; > + u32 pr; > + u32 cnr; > +}; > #endif /* __ASSEMBLER__*/ > #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */ > I see. What do you mind to add a little effort and move the setup of the PWM from the aristaneos board to a PWM driver ? I see there is not (yet) such a driver, but why not ? What we need are only three simple functions exactly as in Linux kernel: pwm_enable() pwm_disable(), pwm_config(duty, period) This becomes more general and can be reused by other i.MX boards. Best regards, Stefano -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================