mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
[linux/fpc-iii.git] / arch / arm / mach-davinci / pdata-quirks.c
blob4858b1cdf31b42f32a72900b74bed46a9d734a96
1 /*
2 * Legacy platform_data quirks
4 * Copyright (C) 2016 BayLibre, Inc
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10 #include <linux/kernel.h>
11 #include <linux/of_platform.h>
13 #include <media/i2c/tvp514x.h>
14 #include <media/i2c/adv7343.h>
16 #include <mach/common.h>
17 #include <mach/da8xx.h>
19 struct pdata_init {
20 const char *compatible;
21 void (*fn)(void);
24 #define TVP5147_CH0 "tvp514x-0"
25 #define TVP5147_CH1 "tvp514x-1"
27 /* VPIF capture configuration */
28 static struct tvp514x_platform_data tvp5146_pdata = {
29 .clk_polarity = 0,
30 .hs_polarity = 1,
31 .vs_polarity = 1,
34 #define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
36 static struct vpif_input da850_ch0_inputs[] = {
38 .input = {
39 .index = 0,
40 .name = "Composite",
41 .type = V4L2_INPUT_TYPE_CAMERA,
42 .capabilities = V4L2_IN_CAP_STD,
43 .std = TVP514X_STD_ALL,
45 .input_route = INPUT_CVBS_VI2B,
46 .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
47 .subdev_name = TVP5147_CH0,
51 static struct vpif_input da850_ch1_inputs[] = {
53 .input = {
54 .index = 0,
55 .name = "S-Video",
56 .type = V4L2_INPUT_TYPE_CAMERA,
57 .capabilities = V4L2_IN_CAP_STD,
58 .std = TVP514X_STD_ALL,
60 .input_route = INPUT_SVIDEO_VI2C_VI1C,
61 .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
62 .subdev_name = TVP5147_CH1,
66 static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = {
68 .name = TVP5147_CH0,
69 .board_info = {
70 I2C_BOARD_INFO("tvp5146", 0x5d),
71 .platform_data = &tvp5146_pdata,
75 .name = TVP5147_CH1,
76 .board_info = {
77 I2C_BOARD_INFO("tvp5146", 0x5c),
78 .platform_data = &tvp5146_pdata,
83 static struct vpif_capture_config da850_vpif_capture_config = {
84 .subdev_info = da850_vpif_capture_sdev_info,
85 .subdev_count = ARRAY_SIZE(da850_vpif_capture_sdev_info),
86 .chan_config[0] = {
87 .inputs = da850_ch0_inputs,
88 .input_count = ARRAY_SIZE(da850_ch0_inputs),
89 .vpif_if = {
90 .if_type = VPIF_IF_BT656,
91 .hd_pol = 1,
92 .vd_pol = 1,
93 .fid_pol = 0,
96 .chan_config[1] = {
97 .inputs = da850_ch1_inputs,
98 .input_count = ARRAY_SIZE(da850_ch1_inputs),
99 .vpif_if = {
100 .if_type = VPIF_IF_BT656,
101 .hd_pol = 1,
102 .vd_pol = 1,
103 .fid_pol = 0,
106 .card_name = "DA850/OMAP-L138 Video Capture",
109 static void __init da850_vpif_legacy_register_capture(void)
111 int ret;
113 ret = da850_register_vpif_capture(&da850_vpif_capture_config);
114 if (ret)
115 pr_warn("%s: VPIF capture setup failed: %d\n",
116 __func__, ret);
119 static void __init da850_vpif_capture_legacy_init_lcdk(void)
121 da850_vpif_capture_config.subdev_count = 1;
122 da850_vpif_legacy_register_capture();
125 static void __init da850_vpif_capture_legacy_init_evm(void)
127 da850_vpif_legacy_register_capture();
130 static struct adv7343_platform_data adv7343_pdata = {
131 .mode_config = {
132 .dac = { 1, 1, 1 },
134 .sd_config = {
135 .sd_dac_out = { 1 },
139 static struct vpif_subdev_info da850_vpif_subdev[] = {
141 .name = "adv7343",
142 .board_info = {
143 I2C_BOARD_INFO("adv7343", 0x2a),
144 .platform_data = &adv7343_pdata,
149 static const struct vpif_output da850_ch0_outputs[] = {
151 .output = {
152 .index = 0,
153 .name = "Composite",
154 .type = V4L2_OUTPUT_TYPE_ANALOG,
155 .capabilities = V4L2_OUT_CAP_STD,
156 .std = V4L2_STD_ALL,
158 .subdev_name = "adv7343",
159 .output_route = ADV7343_COMPOSITE_ID,
162 .output = {
163 .index = 1,
164 .name = "S-Video",
165 .type = V4L2_OUTPUT_TYPE_ANALOG,
166 .capabilities = V4L2_OUT_CAP_STD,
167 .std = V4L2_STD_ALL,
169 .subdev_name = "adv7343",
170 .output_route = ADV7343_SVIDEO_ID,
174 static struct vpif_display_config da850_vpif_display_config = {
175 .subdevinfo = da850_vpif_subdev,
176 .subdev_count = ARRAY_SIZE(da850_vpif_subdev),
177 .chan_config[0] = {
178 .outputs = da850_ch0_outputs,
179 .output_count = ARRAY_SIZE(da850_ch0_outputs),
181 .card_name = "DA850/OMAP-L138 Video Display",
184 static void __init da850_vpif_display_legacy_init_evm(void)
186 int ret;
188 ret = da850_register_vpif_display(&da850_vpif_display_config);
189 if (ret)
190 pr_warn("%s: VPIF display setup failed: %d\n",
191 __func__, ret);
194 static void pdata_quirks_check(struct pdata_init *quirks)
196 while (quirks->compatible) {
197 if (of_machine_is_compatible(quirks->compatible)) {
198 if (quirks->fn)
199 quirks->fn();
201 quirks++;
205 static struct pdata_init pdata_quirks[] __initdata = {
206 { "ti,da850-lcdk", da850_vpif_capture_legacy_init_lcdk, },
207 { "ti,da850-evm", da850_vpif_display_legacy_init_evm, },
208 { "ti,da850-evm", da850_vpif_capture_legacy_init_evm, },
209 { /* sentinel */ },
212 void __init pdata_quirks_init(void)
214 pdata_quirks_check(pdata_quirks);