4 #include <linux/types.h>
5 #include <linux/init.h>
6 #include <linux/device.h>
7 #include <linux/rk_screen.h>
10 struct adc_platform_data {
13 int (*get_base_volt)(void);
22 struct akm8963_platform_data {
29 struct rk30_i2c_platform_data {
32 #define I2C_RK29_ADAP 0
33 #define I2C_RK30_ADAP 1
40 int (*io_deinit)(void);
47 unsigned int cs_iomux_mode;
50 struct rk29xx_spi_platform_data {
51 int (*io_init)(struct spi_cs_gpio*, int);
52 int (*io_deinit)(struct spi_cs_gpio*, int);
53 int (*io_fix_leakage_bug)(void);
54 int (*io_resume_leakage_bug)(void);
55 struct spi_cs_gpio *chipselect_gpios;
60 BRIGHTNESS_MODE_LINE=0,
61 BRIGHTNESS_MODE_CONIC =1,
69 int (*io_deinit)(void);
70 int (*pwm_suspend)(void);
71 int (*pwm_resume)(void);
72 int min_brightness; /* 0 ~ 255 */
73 int max_brightness; /* 0 ~ 255 */
75 unsigned int delay_ms; /* in milliseconds */
80 unsigned long io_addr;
82 unsigned long disable;
89 PMIC_TYPE_TPS65910 =2,
93 PMIC_TYPE_RICOH619 =5,
97 extern __sramdata int g_pmic_type;
98 #define pmic_is_wm8326() (g_pmic_type == PMIC_TYPE_WM8326)
99 #define pmic_is_tps65910() (g_pmic_type == PMIC_TYPE_TPS65910)
100 #define pmic_is_act8931() (g_pmic_type == PMIC_TYPE_ACT8931)
101 #define pmic_is_act8846() (g_pmic_type == PMIC_TYPE_ACT8846)
102 #define pmic_is_rk808() (g_pmic_type == PMIC_TYPE_RK808)
103 #define pmic_is_ricoh619() (g_pmic_type == PMIC_TYPE_RICOH619)
104 #define pmic_is_rt5025() (g_pmic_type == PMIC_TYPE_RT5025)
114 struct rksdmmc_iomux {
115 char *name; //set the MACRO of gpio
120 struct rksdmmc_gpio {
121 int io; //set the address of gpio
123 int enable; // disable = !enable //set the default value,i.e,GPIO_HIGH or GPIO_LOW
124 struct rksdmmc_iomux iomux;
128 struct rksdmmc_gpio_board {
129 struct rksdmmc_gpio clk_gpio;
130 struct rksdmmc_gpio cmd_gpio;
131 struct rksdmmc_gpio data0_gpio;
132 struct rksdmmc_gpio data1_gpio;
133 struct rksdmmc_gpio data2_gpio;
134 struct rksdmmc_gpio data3_gpio;
136 struct rksdmmc_gpio detect_irq;
137 struct rksdmmc_gpio power_en_gpio;
138 struct rksdmmc_gpio write_prt;
139 struct rksdmmc_gpio sdio_irq_gpio;
143 struct rksdmmc_gpio_wifi_moudle {
144 struct rksdmmc_gpio power_n; //PMU_EN
145 struct rksdmmc_gpio reset_n; //SYSRET_B, DAIRST
146 struct rksdmmc_gpio vddio; //power source
147 struct rksdmmc_gpio bgf_int_b;
148 struct rksdmmc_gpio wifi_int_b;
149 struct rksdmmc_gpio gps_sync;
150 struct rksdmmc_gpio ANTSEL2; //pin5--ANTSEL2
151 struct rksdmmc_gpio ANTSEL3; //pin6--ANTSEL3
152 struct rksdmmc_gpio GPS_LAN; //pin33--GPS_LAN
156 struct rk29_sdmmc_platform_data {
157 unsigned int host_caps;
158 unsigned int host_ocr_avail;
159 unsigned int use_dma:1;
161 int (*io_init)(void);
162 int (*io_deinit)(void);
163 void (*set_iomux)(int device_id, unsigned int bus_width);//added by xbw at 2011-10-13
164 int (*status)(struct device *);
165 int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
167 int insert_card_level;
170 int enable_sd_wakeup;
172 int write_prt_enalbe_level;
173 unsigned int sdio_INT_gpio;
175 #define USE_SDIO_INT_LEVEL /*In order to be compatible with old project, those who do not define the member sdio_INT_level */
176 struct rksdmmc_gpio det_pin_info;
177 int (*sd_vcc_reset)(void);
180 struct gsensor_platform_data {
184 signed char orientation[9];
185 int (*get_pendown_state)(void);
186 int (*init_platform_hw)(void);
187 int (*gsensor_platform_sleep)(void);
188 int (*gsensor_platform_wakeup)(void);
189 void (*exit_platform_hw)(void);
192 struct akm8975_platform_data {
193 short m_layout[4][3][3];
194 char project_name[64];
198 struct akm_platform_data {
199 short m_layout[4][3][3];
200 char project_name[64];
208 struct sensor_platform_data {
214 int irq_enable; //if irq_enable=1 then use irq else use polling
215 int poll_delay_ms; //polling
221 unsigned char address;
222 signed char orientation[9];
223 short m_layout[4][3][3];
224 char project_name[64];
225 int (*init_platform_hw)(void);
226 void (*exit_platform_hw)(void);
227 int (*power_on)(void);
228 int (*power_off)(void);
231 /* Platform data for the board id */
232 struct board_id_platform_data {
235 int (*init_platform_hw)(void);
236 int (*exit_platform_hw)(void);
237 int (*init_parameter)(int id);
240 struct ft5506_platform_data {
241 int (*get_pendown_state)(void);
242 int (*init_platform_hw)(void);
243 int (*platform_sleep)(void);
244 int (*platform_wakeup)(void);
245 void (*exit_platform_hw)(void);
247 struct cm3217_platform_data {
250 int (*init_platform_hw)(void);
251 void (*exit_platform_hw)(void);
256 int (*iomux_init)(void);
257 int (*iomux_deinit)(void);
258 int (*irda_pwr_ctl)(int en);
261 struct rk29_gpio_expander_info {
262 unsigned int gpio_num;
263 unsigned int pin_type; //GPIO_IN or GPIO_OUT
264 unsigned int pin_value; //GPIO_HIGH or GPIO_LOW
268 struct rk29_vmac_platform_data {
269 int (*vmac_register_set)(void);
270 int (*rmii_io_init)(void);
271 int (*rmii_io_deinit)(void);
272 int (*rmii_power_control)(int enable);
273 int(*rmii_speed_switch)(int speed);
276 #define LCDC_ON 0x0001
277 #define BACKLIGHT_ON 0x0002
278 struct rk30_adc_battery_platform_data {
279 int (*io_init)(void);
280 int (*io_deinit)(void);
281 int (*is_dc_charging)(void);
282 int (*charging_ok)(void);
284 int (*is_usb_charging)(void);
285 int spport_usb_charging ;
286 int (*control_usb_charging)(int);
295 int ctrl_charge_led_pin;
296 int ctrl_charge_enable;
297 void (*ctrl_charge_led)(int);
302 int charge_set_level;
307 int dc_det_pin_pull; //pull up/down enable/disbale
308 int batt_low_pin_pull;
309 int charge_ok_pin_pull;
310 int charge_set_pin_pull;
312 int low_voltage_protection; // low voltage protection
314 int charging_sleep; // don't have lock,if chargeing_sleep = 0;else have lock
316 int is_reboot_charging;
317 int save_capacity; //save capacity to /data/bat_last_capacity.dat, suggested use
319 int reference_voltage; // the rK2928 is 3300;RK3066 and rk29 are 2500;rk3066B is 1800;
320 int pull_up_res; //divider resistance , pull-up resistor
321 int pull_down_res; //divider resistance , pull-down resistor
323 int time_down_discharge; //the time of capactiy drop 1% --discharge
324 int time_up_charge; //the time of capacity up 1% ---charging
328 int *discharge_table;
331 int *board_batt_table;
335 #ifndef _LINUX_WLAN_PLAT_H_
336 struct wifi_platform_data {
337 int (*set_power)(int val);
338 int (*set_reset)(int val);
339 int (*set_carddetect)(int val);
340 void *(*mem_prealloc)(int section, unsigned long size);
341 int (*get_mac_addr)(unsigned char *buf);
345 struct goodix_platform_data {
349 int (*get_pendown_state)(void);
350 int (*init_platform_hw)(void);
351 int (*platform_sleep)(void);
352 int (*platform_wakeup)(void);
353 void (*exit_platform_hw)(void);
356 struct ct360_platform_data {
360 void (*hw_init)(void);
361 void (*shutdown)(int);
364 struct ft5606_platform_data {
365 int (*get_pendown_state)(void);
366 int (*init_platform_hw)(void);
367 int (*platform_sleep)(void);
368 int (*platform_wakeup)(void);
369 void (*exit_platform_hw)(void);
372 #if defined(CONFIG_TOUCHSCREEN_FT5306) || defined(CONFIG_TOUCHSCREEN_FT5306_WPX2)
373 struct ft5x0x_platform_data{
382 int (*get_pendown_state)(void);
383 int (*init_platform_hw)(void);
384 int (*ft5x0x_platform_sleep)(void);
385 int (*ft5x0x_platform_wakeup)(void);
386 void (*exit_platform_hw)(void);
390 #if defined (CONFIG_TOUCHSCREEN_SITRONIX_A720)
391 struct ft5x0x_platform_data{
393 int (*get_pendown_state)(void);
394 int (*init_platform_hw)(void);
395 int (*ft5x0x_platform_sleep)(void);
396 int (*ft5x0x_platform_wakeup)(void);
397 void (*exit_platform_hw)(void);
398 int (*direction_otation)(int *x ,int *y );
402 #if defined (CONFIG_TOUCHSCREEN_I30)
403 struct ft5306_platform_data {
406 int (*get_pendown_state)(void);
407 int (*init_platform_hw)(void);
408 int (*platform_sleep)(void);
409 int (*platform_wakeup)(void);
410 void (*exit_platform_hw)(void);
414 #if defined (CONFIG_EETI_EGALAX)
415 struct eeti_egalax_platform_data {
417 int (*get_pendown_state)(void);
418 int (*init_platform_hw)(void);
419 int (*eeti_egalax_platform_sleep)(void);
420 int (*eeti_egalax_platform_wakeup)(void);
421 void (*exit_platform_hw)(void);
432 int (*init_platform_hw)(void);
435 #if defined(CONFIG_TOUCHSCREEN_BYD693X)
436 struct byd_platform_data {
444 uint16_t screen_max_x;
445 uint16_t screen_max_y;
452 struct codec_io_info {
457 struct rt3261_platform_data {
458 unsigned int codec_en_gpio;
459 struct codec_io_info codec_en_gpio_info;
460 int (*io_init)(int, char *, int);
461 unsigned int spk_num;
462 unsigned int modem_input_mode;
463 unsigned int lout_to_modem_mode;
464 unsigned int spk_amplify;
465 unsigned int playback_if1_data_control;
466 unsigned int playback_if2_data_control;
469 struct rk610_codec_platform_data {
470 unsigned int spk_ctl_io;
471 int (*io_init)(void);
472 int boot_depop;//if found boot pop,set boot_depop 1 test
474 Some amplifiers enable a longer time.
475 config after pa_enable_io delay pa_enable_time(ms)
476 default = 0,preferably not more than 1000ms
477 so value range is 0 - 1000.
479 unsigned int pa_enable_time;
482 struct rk_hdmi_platform_data {
483 int (*io_init)(void);
485 #define BOOT_MODE_NORMAL 0
486 #define BOOT_MODE_FACTORY2 1
487 #define BOOT_MODE_RECOVERY 2
488 #define BOOT_MODE_CHARGE 3
489 #define BOOT_MODE_POWER_TEST 4
490 #define BOOT_MODE_OFFMODE_CHARGING 5
491 #define BOOT_MODE_REBOOT 6
492 #define BOOT_MODE_PANIC 7
493 #define BOOT_MODE_WATCHDOG 8
494 int board_boot_mode(void);
496 /* for USB detection */
497 #if defined(CONFIG_USB_GADGET) && !defined(CONFIG_RK_USB_DETECT_BY_OTG_BVALID)
498 int __init board_usb_detect_init(unsigned gpio);
500 static int inline board_usb_detect_init(unsigned gpio) { return 0; }
503 #ifdef CONFIG_RK_EARLY_PRINTK
504 void __init rk29_setup_early_printk(void);
506 static void inline rk29_setup_early_printk(void) {}
509 /* for wakeup Android */
510 void rk28_send_wakeup_key(void);
512 /* for reserved memory
513 * function: board_mem_reserve_add
514 * return value: start address of reserved memory */
515 phys_addr_t __init board_mem_reserve_add(char *name, size_t size);
516 void __init board_mem_reserved(void);
518 extern struct rk29_sdmmc_platform_data default_sdmmc0_data;
519 extern struct rk29_sdmmc_platform_data default_sdmmc1_data;
521 extern struct i2c_gpio_platform_data default_i2c_gpio_data;
522 extern struct rk29_vmac_platform_data board_vmac_data;
524 void __init board_clock_init(void);
525 void board_gpio_suspend(void);
526 void board_gpio_resume(void);
527 void __sramfunc board_pmu_suspend(void);
528 void __sramfunc board_pmu_resume(void);
531 * For DDR frequency scaling setup. Board code something like this:
533 * This array _must_ be sorted in ascending frequency (without DDR_FREQ_*) order.
534 * 必须按频率(不必考虑DDR_FREQ_*)递增。
535 *static struct cpufreq_frequency_table dvfs_ddr_table[] = {
536 * {.frequency = 200 * 1000 + DDR_FREQ_SUSPEND, .index = xxxx * 1000},
537 * {.frequency = 200 * 1000 + DDR_FREQ_IDLE, .index = xxxx * 1000},
538 * {.frequency = 300 * 1000 + DDR_FREQ_VIDEO, .index = xxxx * 1000},
539 * {.frequency = 400 * 1000 + DDR_FREQ_NORMAL, .index = xxxx * 1000},
540 * {.frequency = CPUFREQ_TABLE_END},
544 DDR_FREQ_NORMAL = 1, // default
545 DDR_FREQ_VIDEO, // when video is playing
546 DDR_FREQ_DUALVIEW, // when dual view,lcdc0 and lcdc1 open at the same time
547 DDR_FREQ_IDLE, // when screen is idle
548 DDR_FREQ_SUSPEND, // when early suspend