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);
21 struct rk30_i2c_platform_data {
24 #define I2C_RK29_ADAP 0
25 #define I2C_RK30_ADAP 1
32 int (*io_deinit)(void);
39 unsigned int cs_iomux_mode;
42 struct rk29xx_spi_platform_data {
43 int (*io_init)(struct spi_cs_gpio*, int);
44 int (*io_deinit)(struct spi_cs_gpio*, int);
45 int (*io_fix_leakage_bug)(void);
46 int (*io_resume_leakage_bug)(void);
47 struct spi_cs_gpio *chipselect_gpios;
55 int (*io_deinit)(void);
56 int (*pwm_suspend)(void);
57 int (*pwm_resume)(void);
58 int min_brightness; /* 0 ~ 255 */
59 unsigned int delay_ms; /* in milliseconds */
64 unsigned long io_addr;
66 unsigned long disable;
73 PMIC_TYPE_TPS65910 =2,
78 extern __sramdata int g_pmic_type;
79 #define pmic_is_wm8326() (g_pmic_type == PMIC_TYPE_WM8326)
80 #define pmic_is_tps65910() (g_pmic_type == PMIC_TYPE_TPS65910)
81 #define pmic_is_act8931() (g_pmic_type == PMIC_TYPE_ACT8931)
82 #define pmic_is_act8846() (g_pmic_type == PMIC_TYPE_ACT8846)
92 struct rksdmmc_iomux {
93 char *name; //set the MACRO of gpio
99 int io; //set the address of gpio
101 int enable; // disable = !enable //set the default value,i.e,GPIO_HIGH or GPIO_LOW
102 struct rksdmmc_iomux iomux;
106 struct rksdmmc_gpio_board {
107 struct rksdmmc_gpio clk_gpio;
108 struct rksdmmc_gpio cmd_gpio;
109 struct rksdmmc_gpio data0_gpio;
110 struct rksdmmc_gpio data1_gpio;
111 struct rksdmmc_gpio data2_gpio;
112 struct rksdmmc_gpio data3_gpio;
114 struct rksdmmc_gpio detect_irq;
115 struct rksdmmc_gpio power_en_gpio;
116 struct rksdmmc_gpio write_prt;
117 struct rksdmmc_gpio sdio_irq_gpio;
121 struct rksdmmc_gpio_wifi_moudle {
122 struct rksdmmc_gpio power_n; //PMU_EN
123 struct rksdmmc_gpio reset_n; //SYSRET_B, DAIRST
124 struct rksdmmc_gpio vddio; //power source
125 struct rksdmmc_gpio bgf_int_b;
126 struct rksdmmc_gpio wifi_int_b;
127 struct rksdmmc_gpio gps_sync;
128 struct rksdmmc_gpio ANTSEL2; //pin5--ANTSEL2
129 struct rksdmmc_gpio ANTSEL3; //pin6--ANTSEL3
130 struct rksdmmc_gpio GPS_LAN; //pin33--GPS_LAN
134 struct rk29_sdmmc_platform_data {
135 unsigned int host_caps;
136 unsigned int host_ocr_avail;
137 unsigned int use_dma:1;
139 int (*io_init)(void);
140 int (*io_deinit)(void);
141 void (*set_iomux)(int device_id, unsigned int bus_width);//added by xbw at 2011-10-13
142 int (*status)(struct device *);
143 int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
145 int insert_card_level;
148 int enable_sd_wakeup;
150 int write_prt_enalbe_level;
151 unsigned int sdio_INT_gpio;
152 struct rksdmmc_gpio det_pin_info;
153 int (*sd_vcc_reset)(void);
156 struct gsensor_platform_data {
160 signed char orientation[9];
161 int (*get_pendown_state)(void);
162 int (*init_platform_hw)(void);
163 int (*gsensor_platform_sleep)(void);
164 int (*gsensor_platform_wakeup)(void);
165 void (*exit_platform_hw)(void);
168 struct akm8975_platform_data {
169 short m_layout[4][3][3];
170 char project_name[64];
174 struct sensor_platform_data {
179 int irq_enable; //if irq_enable=1 then use irq else use polling
180 int poll_delay_ms; //polling
185 unsigned char address;
186 signed char orientation[9];
187 short m_layout[4][3][3];
188 char project_name[64];
189 int (*init_platform_hw)(void);
190 void (*exit_platform_hw)(void);
191 int (*power_on)(void);
192 int (*power_off)(void);
195 /* Platform data for the board id */
196 struct board_id_platform_data {
199 int (*init_platform_hw)(void);
200 int (*exit_platform_hw)(void);
201 int (*init_parameter)(int id);
204 struct cm3217_platform_data {
207 int (*init_platform_hw)(void);
208 void (*exit_platform_hw)(void);
213 int (*iomux_init)(void);
214 int (*iomux_deinit)(void);
215 int (*irda_pwr_ctl)(int en);
218 struct rk29_gpio_expander_info {
219 unsigned int gpio_num;
220 unsigned int pin_type; //GPIO_IN or GPIO_OUT
221 unsigned int pin_value; //GPIO_HIGH or GPIO_LOW
225 struct rk29_vmac_platform_data {
226 int (*vmac_register_set)(void);
227 int (*rmii_io_init)(void);
228 int (*rmii_io_deinit)(void);
229 int (*rmii_power_control)(int enable);
230 int(*rmii_speed_switch)(int speed);
233 struct rk30_adc_battery_platform_data {
234 int (*io_init)(void);
235 int (*io_deinit)(void);
236 int (*is_dc_charging)(void);
237 int (*charging_ok)(void);
239 int (*is_usb_charging)(void);
240 int spport_usb_charging ;
241 int (*control_usb_charging)(int);
250 int ctrl_charge_led_pin;
251 int ctrl_charge_enable;
252 void (*ctrl_charge_led)(int);
257 int charge_set_level;
262 int dc_det_pin_pull; //pull up/down enable/disbale
263 int batt_low_pin_pull;
264 int charge_ok_pin_pull;
265 int charge_set_pin_pull;
267 int low_voltage_protection; // low voltage protection
269 int charging_sleep; // don't have lock,if chargeing_sleep = 0;else have lock
271 int is_reboot_charging;
272 int save_capacity; //save capacity to /data/bat_last_capacity.dat, suggested use
274 int reference_voltage; // the rK2928 is 3300;RK3066 and rk29 are 2500;rk3066B is 1800;
275 int pull_up_res; //divider resistance , pull-up resistor
276 int pull_down_res; //divider resistance , pull-down resistor
278 int time_down_discharge; //the time of capactiy drop 1% --discharge
279 int time_up_charge; //the time of capacity up 1% ---charging
283 int *discharge_table;
286 int *board_batt_table;
290 #ifndef _LINUX_WLAN_PLAT_H_
291 struct wifi_platform_data {
292 int (*set_power)(int val);
293 int (*set_reset)(int val);
294 int (*set_carddetect)(int val);
295 void *(*mem_prealloc)(int section, unsigned long size);
296 int (*get_mac_addr)(unsigned char *buf);
300 struct goodix_platform_data {
304 int (*get_pendown_state)(void);
305 int (*init_platform_hw)(void);
306 int (*platform_sleep)(void);
307 int (*platform_wakeup)(void);
308 void (*exit_platform_hw)(void);
311 struct ct360_platform_data {
315 void (*hw_init)(void);
316 void (*shutdown)(int);
319 struct ft5606_platform_data {
320 int (*get_pendown_state)(void);
321 int (*init_platform_hw)(void);
322 int (*platform_sleep)(void);
323 int (*platform_wakeup)(void);
324 void (*exit_platform_hw)(void);
327 #if defined(CONFIG_TOUCHSCREEN_FT5306) || defined(CONFIG_TOUCHSCREEN_FT5306_WPX2)
328 struct ft5x0x_platform_data{
337 int (*get_pendown_state)(void);
338 int (*init_platform_hw)(void);
339 int (*ft5x0x_platform_sleep)(void);
340 int (*ft5x0x_platform_wakeup)(void);
341 void (*exit_platform_hw)(void);
345 #if defined (CONFIG_TOUCHSCREEN_SITRONIX_A720)
346 struct ft5x0x_platform_data{
348 int (*get_pendown_state)(void);
349 int (*init_platform_hw)(void);
350 int (*ft5x0x_platform_sleep)(void);
351 int (*ft5x0x_platform_wakeup)(void);
352 void (*exit_platform_hw)(void);
353 int (*direction_otation)(int *x ,int *y );
357 #if defined (CONFIG_TOUCHSCREEN_I30)
358 struct ft5306_platform_data {
361 int (*get_pendown_state)(void);
362 int (*init_platform_hw)(void);
363 int (*platform_sleep)(void);
364 int (*platform_wakeup)(void);
365 void (*exit_platform_hw)(void);
369 #if defined (CONFIG_EETI_EGALAX)
370 struct eeti_egalax_platform_data {
372 int (*get_pendown_state)(void);
373 int (*init_platform_hw)(void);
374 int (*eeti_egalax_platform_sleep)(void);
375 int (*eeti_egalax_platform_wakeup)(void);
376 void (*exit_platform_hw)(void);
389 #if defined(CONFIG_TOUCHSCREEN_BYD693X)
390 struct byd_platform_data {
398 uint16_t screen_max_x;
399 uint16_t screen_max_y;
406 struct codec_io_info {
411 struct rt3261_platform_data {
412 unsigned int codec_en_gpio;
413 struct codec_io_info codec_en_gpio_info;
414 int (*io_init)(int, char *, int);
415 unsigned int spk_num;
416 unsigned int modem_input_mode;
417 unsigned int lout_to_modem_mode;
418 unsigned int spk_amplify;
419 unsigned int playback_if1_data_control;
420 unsigned int playback_if2_data_control;
423 struct rk610_codec_platform_data {
424 unsigned int spk_ctl_io;
425 int (*io_init)(void);
426 int boot_depop;//if found boot pop,set boot_depop 1 test
429 #define BOOT_MODE_NORMAL 0
430 #define BOOT_MODE_FACTORY2 1
431 #define BOOT_MODE_RECOVERY 2
432 #define BOOT_MODE_CHARGE 3
433 #define BOOT_MODE_POWER_TEST 4
434 #define BOOT_MODE_OFFMODE_CHARGING 5
435 #define BOOT_MODE_REBOOT 6
436 #define BOOT_MODE_PANIC 7
437 int board_boot_mode(void);
439 /* for USB detection */
440 #ifdef CONFIG_USB_GADGET
441 int __init board_usb_detect_init(unsigned gpio);
443 static int inline board_usb_detect_init(unsigned gpio) { return 0; }
446 #ifdef CONFIG_RK_EARLY_PRINTK
447 void __init rk29_setup_early_printk(void);
449 static void inline rk29_setup_early_printk(void) {}
452 /* for wakeup Android */
453 void rk28_send_wakeup_key(void);
455 /* for reserved memory
456 * function: board_mem_reserve_add
457 * return value: start address of reserved memory */
458 phys_addr_t __init board_mem_reserve_add(char *name, size_t size);
459 void __init board_mem_reserved(void);
461 extern struct rk29_sdmmc_platform_data default_sdmmc0_data;
462 extern struct rk29_sdmmc_platform_data default_sdmmc1_data;
464 extern struct i2c_gpio_platform_data default_i2c_gpio_data;
465 extern struct rk29_vmac_platform_data board_vmac_data;
467 void __init board_clock_init(void);
468 void board_gpio_suspend(void);
469 void board_gpio_resume(void);
470 void __sramfunc board_pmu_suspend(void);
471 void __sramfunc board_pmu_resume(void);
474 * For DDR frequency scaling setup. Board code something like this:
476 * This array _must_ be sorted in ascending frequency (without DDR_FREQ_*) order.
477 * 必须按频率(不必考虑DDR_FREQ_*)递增。
478 *static struct cpufreq_frequency_table dvfs_ddr_table[] = {
479 * {.frequency = 200 * 1000 + DDR_FREQ_SUSPEND, .index = xxxx * 1000},
480 * {.frequency = 200 * 1000 + DDR_FREQ_IDLE, .index = xxxx * 1000},
481 * {.frequency = 300 * 1000 + DDR_FREQ_VIDEO, .index = xxxx * 1000},
482 * {.frequency = 400 * 1000 + DDR_FREQ_NORMAL, .index = xxxx * 1000},
483 * {.frequency = CPUFREQ_TABLE_END},
487 DDR_FREQ_NORMAL = 1, // default
488 DDR_FREQ_VIDEO, // when video is playing
489 DDR_FREQ_IDLE, // when screen is idle
490 DDR_FREQ_SUSPEND, // when early suspend