Commit 803c2df217525495fc440fc9b314b22427dc5db6
Committed by
Mauro Carvalho Chehab
1 parent
6a4760ed50
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
[media] ARM: shmobile: r8a7778: add VIN support
Add VIN clocks and platform devices on R8A7778 SoC; add function to register the VIN platform devices. [Sergei: added 'id' parameter check to r8a7778_add_vin_device(), used '*pdata' in *sizeof* operator, and added an empty line there; renamed some variables, annotated 'vin[01]_info' and vin[01]_resources[] as '__initdata'.] Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Showing 3 changed files with 42 additions and 0 deletions Side-by-side Diff
arch/arm/mach-shmobile/clock-r8a7778.c
... | ... | @@ -106,6 +106,7 @@ |
106 | 106 | MSTP331, |
107 | 107 | MSTP323, MSTP322, MSTP321, |
108 | 108 | MSTP114, |
109 | + MSTP110, MSTP109, | |
109 | 110 | MSTP100, |
110 | 111 | MSTP030, |
111 | 112 | MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, |
... | ... | @@ -119,6 +120,8 @@ |
119 | 120 | [MSTP322] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 22, 0), /* SDHI1 */ |
120 | 121 | [MSTP321] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 21, 0), /* SDHI2 */ |
121 | 122 | [MSTP114] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 14, 0), /* Ether */ |
123 | + [MSTP110] = SH_CLK_MSTP32(&s_clk, MSTPCR1, 10, 0), /* VIN0 */ | |
124 | + [MSTP109] = SH_CLK_MSTP32(&s_clk, MSTPCR1, 9, 0), /* VIN1 */ | |
122 | 125 | [MSTP100] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 0, 0), /* USB0/1 */ |
123 | 126 | [MSTP030] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 30, 0), /* I2C0 */ |
124 | 127 | [MSTP029] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 29, 0), /* I2C1 */ |
... | ... | @@ -146,6 +149,8 @@ |
146 | 149 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */ |
147 | 150 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */ |
148 | 151 | CLKDEV_DEV_ID("r8a777x-ether", &mstp_clks[MSTP114]), /* Ether */ |
152 | + CLKDEV_DEV_ID("r8a7778-vin.0", &mstp_clks[MSTP110]), /* VIN0 */ | |
153 | + CLKDEV_DEV_ID("r8a7778-vin.1", &mstp_clks[MSTP109]), /* VIN1 */ | |
149 | 154 | CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ |
150 | 155 | CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ |
151 | 156 | CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ |
arch/arm/mach-shmobile/include/mach/r8a7778.h
... | ... | @@ -22,6 +22,7 @@ |
22 | 22 | #include <linux/mmc/sh_mobile_sdhi.h> |
23 | 23 | #include <linux/sh_eth.h> |
24 | 24 | #include <linux/platform_data/usb-rcar-phy.h> |
25 | +#include <linux/platform_data/camera-rcar.h> | |
25 | 26 | |
26 | 27 | extern void r8a7778_add_standard_devices(void); |
27 | 28 | extern void r8a7778_add_standard_devices_dt(void); |
... | ... | @@ -30,6 +31,8 @@ |
30 | 31 | extern void r8a7778_add_i2c_device(int id); |
31 | 32 | extern void r8a7778_add_hspi_device(int id); |
32 | 33 | extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info); |
34 | +extern void r8a7778_add_vin_device(int id, | |
35 | + struct rcar_vin_platform_data *pdata); | |
33 | 36 | |
34 | 37 | extern void r8a7778_init_late(void); |
35 | 38 | extern void r8a7778_init_delay(void); |
arch/arm/mach-shmobile/setup-r8a7778.c
... | ... | @@ -333,6 +333,40 @@ |
333 | 333 | info, sizeof(*info)); |
334 | 334 | } |
335 | 335 | |
336 | +/* VIN */ | |
337 | +#define R8A7778_VIN(idx) \ | |
338 | +static struct resource vin##idx##_resources[] __initdata = { \ | |
339 | + DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \ | |
340 | + DEFINE_RES_IRQ(gic_iid(0x5a)), \ | |
341 | +}; \ | |
342 | + \ | |
343 | +static struct platform_device_info vin##idx##_info __initdata = { \ | |
344 | + .parent = &platform_bus, \ | |
345 | + .name = "r8a7778-vin", \ | |
346 | + .id = idx, \ | |
347 | + .res = vin##idx##_resources, \ | |
348 | + .num_res = ARRAY_SIZE(vin##idx##_resources), \ | |
349 | + .dma_mask = DMA_BIT_MASK(32), \ | |
350 | +} | |
351 | + | |
352 | +R8A7778_VIN(0); | |
353 | +R8A7778_VIN(1); | |
354 | + | |
355 | +static struct platform_device_info *vin_info_table[] __initdata = { | |
356 | + &vin0_info, | |
357 | + &vin1_info, | |
358 | +}; | |
359 | + | |
360 | +void __init r8a7778_add_vin_device(int id, struct rcar_vin_platform_data *pdata) | |
361 | +{ | |
362 | + BUG_ON(id < 0 || id > 1); | |
363 | + | |
364 | + vin_info_table[id]->data = pdata; | |
365 | + vin_info_table[id]->size_data = sizeof(*pdata); | |
366 | + | |
367 | + platform_device_register_full(vin_info_table[id]); | |
368 | +} | |
369 | + | |
336 | 370 | void __init r8a7778_add_standard_devices(void) |
337 | 371 | { |
338 | 372 | int i; |