aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-10-20 09:15:49 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-10-24 21:46:05 -0400
commit1a0b1eac5012326e52d1dcf78695ac08f41c37d7 (patch)
tree4ae418be7fc663744f72abdb9d6f1870ae115edb /arch/arm/mach-shmobile
parent88c759a2c82d0c98f6a59165b409112effad75bd (diff)
ARM: arch-shmobile: Add IMX074 camera sensor data to the AP4EVB platform
Add platform data, necessary to use Sony IMX074 camera sensor with AP4EVB. Note: this does not work reliably without an API to reserve contiguous and coherent memory for V4L DMA buffers. Such memory reservation has to be added as soon as a suitable API becomes available. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c113
1 files changed, 113 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 901000ceb540..bb1790784cf7 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -43,6 +43,10 @@
43#include <linux/input/sh_keysc.h> 43#include <linux/input/sh_keysc.h>
44#include <linux/usb/r8a66597.h> 44#include <linux/usb/r8a66597.h>
45 45
46#include <media/sh_mobile_ceu.h>
47#include <media/sh_mobile_csi2.h>
48#include <media/soc_camera.h>
49
46#include <sound/sh_fsi.h> 50#include <sound/sh_fsi.h>
47 51
48#include <video/sh_mobile_hdmi.h> 52#include <video/sh_mobile_hdmi.h>
@@ -677,6 +681,95 @@ static struct platform_device leds_device = {
677 }, 681 },
678}; 682};
679 683
684static struct i2c_board_info imx074_info = {
685 I2C_BOARD_INFO("imx074", 0x1a),
686};
687
688struct soc_camera_link imx074_link = {
689 .bus_id = 0,
690 .board_info = &imx074_info,
691 .i2c_adapter_id = 0,
692 .module_name = "imx074",
693};
694
695static struct platform_device ap4evb_camera = {
696 .name = "soc-camera-pdrv",
697 .id = 0,
698 .dev = {
699 .platform_data = &imx074_link,
700 },
701};
702
703static struct sh_csi2_client_config csi2_clients[] = {
704 {
705 .phy = SH_CSI2_PHY_MAIN,
706 .lanes = 3,
707 .channel = 0,
708 .pdev = &ap4evb_camera,
709 },
710};
711
712static struct sh_csi2_pdata csi2_info = {
713 .type = SH_CSI2C,
714 .clients = csi2_clients,
715 .num_clients = ARRAY_SIZE(csi2_clients),
716 .flags = SH_CSI2_ECC | SH_CSI2_CRC,
717};
718
719static struct resource csi2_resources[] = {
720 [0] = {
721 .name = "CSI2",
722 .start = 0xffc90000,
723 .end = 0xffc90fff,
724 .flags = IORESOURCE_MEM,
725 },
726 [1] = {
727 .start = intcs_evt2irq(0x17a0),
728 .flags = IORESOURCE_IRQ,
729 },
730};
731
732static struct platform_device csi2_device = {
733 .name = "sh-mobile-csi2",
734 .id = 0,
735 .num_resources = ARRAY_SIZE(csi2_resources),
736 .resource = csi2_resources,
737 .dev = {
738 .platform_data = &csi2_info,
739 },
740};
741
742static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
743 .flags = SH_CEU_FLAG_USE_8BIT_BUS,
744 .csi2_dev = &csi2_device.dev,
745};
746
747static struct resource ceu_resources[] = {
748 [0] = {
749 .name = "CEU",
750 .start = 0xfe910000,
751 .end = 0xfe91009f,
752 .flags = IORESOURCE_MEM,
753 },
754 [1] = {
755 .start = intcs_evt2irq(0x880),
756 .flags = IORESOURCE_IRQ,
757 },
758 [2] = {
759 /* place holder for contiguous memory */
760 },
761};
762
763static struct platform_device ceu_device = {
764 .name = "sh_mobile_ceu",
765 .id = 0, /* "ceu0" clock */
766 .num_resources = ARRAY_SIZE(ceu_resources),
767 .resource = ceu_resources,
768 .dev = {
769 .platform_data = &sh_mobile_ceu_info,
770 },
771};
772
680static struct platform_device *ap4evb_devices[] __initdata = { 773static struct platform_device *ap4evb_devices[] __initdata = {
681 &leds_device, 774 &leds_device,
682 &nor_flash_device, 775 &nor_flash_device,
@@ -689,6 +782,9 @@ static struct platform_device *ap4evb_devices[] __initdata = {
689 &lcdc1_device, 782 &lcdc1_device,
690 &lcdc_device, 783 &lcdc_device,
691 &hdmi_device, 784 &hdmi_device,
785 &csi2_device,
786 &ceu_device,
787 &ap4evb_camera,
692}; 788};
693 789
694static int __init hdmi_init_pm_clock(void) 790static int __init hdmi_init_pm_clock(void)
@@ -1066,6 +1162,23 @@ static void __init ap4evb_init(void)
1066 i2c_register_board_info(0, &tsc_device, 1); 1162 i2c_register_board_info(0, &tsc_device, 1);
1067#endif /* CONFIG_AP4EVB_QHD */ 1163#endif /* CONFIG_AP4EVB_QHD */
1068 1164
1165 /* CEU */
1166
1167 /*
1168 * TODO: reserve memory for V4L2 DMA buffers, when a suitable API
1169 * becomes available
1170 */
1171
1172 /* MIPI-CSI stuff */
1173 gpio_request(GPIO_FN_VIO_CKO, NULL);
1174
1175 clk = clk_get(NULL, "vck1_clk");
1176 if (!IS_ERR(clk)) {
1177 clk_set_rate(clk, clk_round_rate(clk, 13000000));
1178 clk_enable(clk);
1179 clk_put(clk);
1180 }
1181
1069 sh7372_add_standard_devices(); 1182 sh7372_add_standard_devices();
1070 1183
1071 /* HDMI */ 1184 /* HDMI */