From: g.liakhovetski@gmx.de (Guennadi Liakhovetski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] mx25: add support for the CSI device
Date: Wed, 12 May 2010 21:11:41 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.64.1005122110410.4970@axis700.grange> (raw)
In-Reply-To: <e2a1cd7e286c8fe799cbbd145b1eb8e7dcea90ee.1273150585.git.baruch@tkos.co.il>
On Thu, 6 May 2010, Baruch Siach wrote:
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> arch/arm/mach-mx25/clock.c | 14 ++++++++++++--
> arch/arm/mach-mx25/devices.c | 22 ++++++++++++++++++++++
> arch/arm/mach-mx25/devices.h | 1 +
> arch/arm/plat-mxc/include/mach/mx25.h | 2 ++
> 4 files changed, 37 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c
> index 1550149..7a98d18 100644
> --- a/arch/arm/mach-mx25/clock.c
> +++ b/arch/arm/mach-mx25/clock.c
> @@ -129,6 +129,11 @@ static unsigned long get_rate_lcdc(struct clk *clk)
> return get_rate_per(7);
> }
>
> +static unsigned long get_rate_csi(struct clk *clk)
> +{
> + return get_rate_per(0);
> +}
> +
> static unsigned long get_rate_otg(struct clk *clk)
> {
> return 48000000; /* FIXME */
> @@ -174,6 +179,8 @@ DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL);
> DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL);
> DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL);
> DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk);
> +DEFINE_CLOCK(csi_ahb_clk, 0, CCM_CGCR0, 18, get_rate_csi, NULL, NULL);
> +DEFINE_CLOCK(csi_per_clk, 0, CCM_CGCR0, 0, get_rate_csi, NULL, &csi_ahb_clk);
> DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL, &uart_per_clk);
> DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL, &uart_per_clk);
> DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL, &uart_per_clk);
> @@ -191,6 +198,7 @@ DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL, NULL);
> DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk);
> DEFINE_CLOCK(dryice_clk, 0, CCM_CGCR1, 8, get_rate_ipg, NULL, NULL);
> DEFINE_CLOCK(lcdc_clk, 0, CCM_CGCR1, 29, get_rate_lcdc, NULL, &lcdc_per_clk);
> +DEFINE_CLOCK(csi_clk, 0, CCM_CGCR1, 4, get_rate_csi, NULL, &csi_per_clk);
>
> #define _REGISTER_CLOCK(d, n, c) \
> { \
> @@ -225,6 +233,7 @@ static struct clk_lookup lookups[] = {
> _REGISTER_CLOCK("fec.0", NULL, fec_clk)
> _REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk)
> _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
> + _REGISTER_CLOCK("mx2-camera.0", NULL, csi_clk)
> };
>
> int __init mx25_clocks_init(void)
> @@ -239,8 +248,9 @@ int __init mx25_clocks_init(void)
> __raw_writel((0xf << 16) | (3 << 26), CRM_BASE + CCM_CGCR1);
> __raw_writel((1 << 5), CRM_BASE + CCM_CGCR2);
>
> - /* Clock source for lcdc is upll */
> - __raw_writel(__raw_readl(CRM_BASE+0x64) | (1 << 7), CRM_BASE + 0x64);
> + /* Clock source for lcdc and csi is upll */
> + __raw_writel(__raw_readl(CRM_BASE+0x64) | (1 << 7) | (1 << 0),
> + CRM_BASE + 0x64);
>
> mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54);
>
> diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c
> index 3f4b8a0..bc6d189 100644
> --- a/arch/arm/mach-mx25/devices.c
> +++ b/arch/arm/mach-mx25/devices.c
> @@ -500,3 +500,25 @@ struct platform_device mx25_fb_device = {
> .coherent_dma_mask = 0xFFFFFFFF,
> },
> };
> +
> +static struct resource mx25_csi_resources[] = {
> + {
> + .start = MX25_CSI_BASE_ADDR,
> + .end = MX25_CSI_BASE_ADDR + 0xfff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = MX25_INT_CSI,
> + .flags = IORESOURCE_IRQ
Please, also specify .end (= .start).
> + },
> +};
> +
> +struct platform_device mx25_csi_device = {
> + .name = "mx2-camera",
> + .id = 0,
> + .num_resources = ARRAY_SIZE(mx25_csi_resources),
> + .resource = mx25_csi_resources,
> + .dev = {
> + .coherent_dma_mask = 0xFFFFFFFF,
> + },
> +};
> diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h
> index 39560e1..1e80ac2 100644
> --- a/arch/arm/mach-mx25/devices.h
> +++ b/arch/arm/mach-mx25/devices.h
> @@ -21,3 +21,4 @@ extern struct platform_device mx25_fec_device;
> extern struct platform_device mxc_nand_device;
> extern struct platform_device mx25_rtc_device;
> extern struct platform_device mx25_fb_device;
> +extern struct platform_device mx25_csi_device;
> diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h
> index 4eb6e33..5e6a8b5 100644
> --- a/arch/arm/plat-mxc/include/mach/mx25.h
> +++ b/arch/arm/plat-mxc/include/mach/mx25.h
> @@ -34,11 +34,13 @@
> #define MX25_NFC_BASE_ADDR 0xbb000000
> #define MX25_DRYICE_BASE_ADDR 0x53ffc000
> #define MX25_LCDC_BASE_ADDR 0x53fbc000
> +#define MX25_CSI_BASE_ADDR 0x53ff8000
>
> #define MX25_INT_DRYICE 25
> #define MX25_INT_FEC 57
> #define MX25_INT_NANDFC 33
> #define MX25_INT_LCDC 39
> +#define MX25_INT_CSI 17
>
> #if defined(IMX_NEEDS_DEPRECATED_SYMBOLS)
> #define UART1_BASE_ADDR MX25_UART1_BASE_ADDR
> --
> 1.7.0
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
next prev parent reply other threads:[~2010-05-12 19:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-06 13:09 [PATCH 0/3] Driver for the i.MX2x CMOS Sensor Interface Baruch Siach
2010-05-06 13:09 ` [PATCH 1/3] mx2_camera: Add soc_camera support for i.MX25/i.MX27 Baruch Siach
2010-05-12 19:02 ` Guennadi Liakhovetski
2010-05-13 5:21 ` Baruch Siach
2010-05-17 7:27 ` Sascha Hauer
2010-05-17 13:58 ` Baruch Siach
2010-05-19 8:55 ` Sascha Hauer
2010-05-21 7:19 ` Sascha Hauer
2010-05-06 13:09 ` [PATCH 2/3] mx27: add support for the CSI device Baruch Siach
2010-05-21 7:17 ` Sascha Hauer
2010-05-06 13:09 ` [PATCH 3/3] mx25: " Baruch Siach
2010-05-12 19:11 ` Guennadi Liakhovetski [this message]
2010-05-21 7:20 ` [PATCH 0/3] Driver for the i.MX2x CMOS Sensor Interface Sascha Hauer
2010-05-21 7:27 ` Baruch Siach
2010-05-21 18:33 ` Guennadi Liakhovetski
2010-05-25 7:20 ` Sascha Hauer
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=Pine.LNX.4.64.1005122110410.4970@axis700.grange \
--to=g.liakhovetski@gmx.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox