diff options
Diffstat (limited to 'include/linux/platform_data')
-rw-r--r-- | include/linux/platform_data/cypress_cyttsp4.h | 67 | ||||
-rw-r--r-- | include/linux/platform_data/lte_modem_bootloader.h | 8 | ||||
-rw-r--r-- | include/linux/platform_data/mms152_ts.h | 46 | ||||
-rw-r--r-- | include/linux/platform_data/mms_ts.h | 2 | ||||
-rw-r--r-- | include/linux/platform_data/mms_ts_gc.h | 6 | ||||
-rw-r--r-- | include/linux/platform_data/modem.h | 155 | ||||
-rw-r--r-- | include/linux/platform_data/modem_na.h | 171 | ||||
-rw-r--r-- | include/linux/platform_data/usb3503_otg_conn.h | 22 |
8 files changed, 405 insertions, 72 deletions
diff --git a/include/linux/platform_data/cypress_cyttsp4.h b/include/linux/platform_data/cypress_cyttsp4.h new file mode 100644 index 0000000..03819d6 --- /dev/null +++ b/include/linux/platform_data/cypress_cyttsp4.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010 Motorola Mobility, Inc. + * Modified by Cypress Semiconductor 2011-2012 + * - increase touch_settings.size from uint8_t to uint32_t + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307, USA + */ + +/* Defines generic platform structures for touch drivers */ +#ifndef _LINUX_TOUCH_PLATFORM_H +#define _LINUX_TOUCH_PLATFORM_H + +#include <linux/types.h> + +enum { + GPIO_TOUCH_nINT = 0, + GPIO_TOUCH_EN, + GPIO_TOUCH_SCL, + GPIO_TOUCH_SDA +}; + +struct touch_settings { + const uint8_t *data; + uint32_t size; + uint8_t tag; +} __attribute__ ((packed)); + +struct touch_firmware { + const uint8_t *img; + uint32_t size; + const uint8_t *ver; + uint8_t vsize; +} __attribute__ ((packed)); + +struct touch_framework { + const uint16_t *abs; + uint8_t size; + uint8_t enable_vkeys; +} __attribute__ ((packed)); + +struct touch_platform_data { + struct touch_settings *sett[256]; + struct touch_firmware *fw; + struct touch_framework *frmwrk; + + uint8_t addr[2]; + uint16_t flags; + + int (*hw_reset)(void); + int (*hw_power)(int); + int (*hw_recov)(int); + int (*irq_stat)(void); +} __attribute__ ((packed)); + +#endif /* _LINUX_TOUCH_PLATFORM_H */ diff --git a/include/linux/platform_data/lte_modem_bootloader.h b/include/linux/platform_data/lte_modem_bootloader.h index 27a0450..893a1aa 100644 --- a/include/linux/platform_data/lte_modem_bootloader.h +++ b/include/linux/platform_data/lte_modem_bootloader.h @@ -21,12 +21,8 @@ #define IOCTL_LTE_MODEM_XMIT_BOOT _IOW('o', 0x23, unsigned int) #define IOCTL_LTE_MODEM_LTE2AP_STATUS _IOR('o', 0x24, unsigned int) -#define AIRPLAIN_MODE_TEST - -#ifdef AIRPLAIN_MODE_TEST -#define IOCTL_LTE_MODEM_AIRPLAIN_ON _IOWR('o', 0x25, unsigned int) -#define IOCTL_LTE_MODEM_AIRPLAIN_OFF _IOWR('o', 0x26, unsigned int) -#endif +#define IOCTL_LTE_MODEM_FACTORY_MODE_ON _IOWR('o', 0x25, unsigned int) +#define IOCTL_LTE_MODEM_FACTORY_MODE_OFF _IOWR('o', 0x26, unsigned int) struct lte_modem_bootloader_param { char __user *buf; diff --git a/include/linux/platform_data/mms152_ts.h b/include/linux/platform_data/mms152_ts.h new file mode 100644 index 0000000..29ddd48 --- /dev/null +++ b/include/linux/platform_data/mms152_ts.h @@ -0,0 +1,46 @@ +/* + * mms_ts.h - Platform data for Melfas MMS-series touch driver + * + * Copyright (C) 2011 Google Inc. + * Author: Dima Zavin <dima@android.com> + * + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ + +#ifndef _LINUX_MMS_TOUCH_H +#define _LINUX_MMS_TOUCH_H +#define MELFAS_TS_NAME "melfas-ts" + +struct melfas_tsi_platform_data { + int max_x; + int max_y; + + bool invert_x; + bool invert_y; + + int gpio_int; + int gpio_sda; + int gpio_scl; + int (*mux_fw_flash) (bool to_gpios); + int (*power) (bool on); + int (*is_vdd_on) (void); + const char *fw_name; + bool use_touchkey; + const u8 *touchkey_keycode; + const u8 *config_fw_version; +#ifdef CONFIG_INPUT_FBSUSPEND + struct notifier_block fb_notif; +#endif + void (*input_event) (void *data); + int (*lcd_type) (void); + void (*register_cb) (void *); +}; +extern struct class *sec_class; +void tsp_charger_infom(bool en); + +#endif /* _LINUX_MMS_TOUCH_H */ diff --git a/include/linux/platform_data/mms_ts.h b/include/linux/platform_data/mms_ts.h index 8c51e58..a8448a6 100644 --- a/include/linux/platform_data/mms_ts.h +++ b/include/linux/platform_data/mms_ts.h @@ -27,7 +27,7 @@ struct melfas_tsi_platform_data { int gpio_sda; int gpio_scl; int (*mux_fw_flash) (bool to_gpios); - int (*power) (int on); + int (*power) (bool on); int (*is_vdd_on) (void); const char *fw_name; bool use_touchkey; diff --git a/include/linux/platform_data/mms_ts_gc.h b/include/linux/platform_data/mms_ts_gc.h index 318dadf..76a383e 100644 --- a/include/linux/platform_data/mms_ts_gc.h +++ b/include/linux/platform_data/mms_ts_gc.h @@ -28,7 +28,11 @@ struct melfas_tsi_platform_data { int gpio_scl; int (*mux_fw_flash)(bool to_gpios); int (*power)(int on); - const char *fw_name; + u8 *tsp_vendor; + u8 *tsp_ic; + int tsp_tx; + int tsp_rx; + int fw_version; const u8 *config_fw_version; void (*input_event)(void *data); void (*register_cb)(void *); diff --git a/include/linux/platform_data/modem.h b/include/linux/platform_data/modem.h index d66af9f..8eb949c 100644 --- a/include/linux/platform_data/modem.h +++ b/include/linux/platform_data/modem.h @@ -23,7 +23,10 @@ enum modem_t { VIA_CBP72, SEC_CMC221, QC_MDM6600, + QC_ESC6270, + SPRD_SC8803, DUMMY, + MAX_MODEM_TYPE }; enum dev_format { @@ -36,7 +39,8 @@ enum dev_format { IPC_RAMDUMP, MAX_DEV_FORMAT, }; -#define MAX_IPC_DEV (IPC_RFS + 1) +#define MAX_IPC_DEV (IPC_RFS + 1) /* FMT, RAW, RFS */ +#define MAX_SIPC5_DEV (IPC_RAW + 1) /* FMT, RAW */ enum modem_io { IODEV_MISC, @@ -52,6 +56,7 @@ enum modem_link { LINKDEV_USB, LINKDEV_HSIC, LINKDEV_C2C, + LINKDEV_PLD, LINKDEV_MAX, }; #define LINKTYPE(modem_link) (1u << (modem_link)) @@ -59,6 +64,7 @@ enum modem_link { enum modem_network { UMTS_NETWORK, CDMA_NETWORK, + TDSCDMA_NETWORK, LTE_NETWORK, }; @@ -108,15 +114,20 @@ struct modemlink_pm_data { unsigned gpio_link_hostwake; unsigned gpio_link_slavewake; int (*link_reconnect)(void); + + /* usb hub only */ int (*port_enable)(int, int); - int *p_hub_status; + int (*hub_standby)(void *); + void *hub_pm_data; bool has_usbhub; + /* cpu/bus frequency lock */ atomic_t freqlock; - int (*cpufreq_lock)(void); - int (*cpufreq_unlock)(void); + int (*freq_lock)(struct device *dev); + int (*freq_unlock)(struct device *dev); int autosuspend_delay_ms; /* if zero, the default value is used */ + void (*ehci_reg_dump)(struct device *); }; struct modemlink_pm_link_activectl { @@ -124,14 +135,25 @@ struct modemlink_pm_link_activectl { int gpio_request_host_active; }; +#define RES_CP_ACTIVE_IRQ_ID 0 +#define RES_DPRAM_MEM_ID 1 +#define RES_DPRAM_IRQ_ID 2 +#define RES_DPRAM_SFR_ID 3 + enum dpram_type { EXT_DPRAM, - CP_IDPRAM, AP_IDPRAM, - C2C_DPRAM, + CP_IDPRAM, + SHM_DPRAM, MAX_DPRAM_TYPE }; +#define DPRAM_SIZE_8KB 0x02000 +#define DPRAM_SIZE_16KB 0x04000 +#define DPRAM_SIZE_32KB 0x08000 +#define DPRAM_SIZE_64KB 0x10000 +#define DPRAM_SIZE_128KB 0x20000 + enum dpram_speed { DPRAM_SPEED_LOW, DPRAM_SPEED_MID, @@ -159,6 +181,19 @@ struct dpram_ipc_device { }; struct dpram_ipc_map { +#if defined(CONFIG_LINK_DEVICE_PLD) + u16 __iomem *mbx_ap2cp; + u16 __iomem *magic_ap2cp; + u16 __iomem *access_ap2cp; + + u16 __iomem *mbx_cp2ap; + u16 __iomem *magic_cp2ap; + u16 __iomem *access_cp2ap; + + struct dpram_ipc_device dev[MAX_IPC_DEV]; + + u16 __iomem *address_buffer; +#else u16 __iomem *magic; u16 __iomem *access; @@ -166,75 +201,38 @@ struct dpram_ipc_map { u16 __iomem *mbx_cp2ap; u16 __iomem *mbx_ap2cp; +#endif }; struct modemlink_dpram_control { void (*reset)(void); - void (*setup_speed)(enum dpram_speed); - int (*wakeup)(void); - void (*sleep)(void); - void (*clear_intr)(void); - u16 (*recv_intr)(void); + u16 (*recv_intr)(void); void (*send_intr)(u16); - u16 (*recv_msg)(void); + u16 (*recv_msg)(void); void (*send_msg)(u16); - u16 (*get_magic)(void); - void (*set_magic)(u16); - - u16 (*get_access)(void); - void (*set_access)(u16); - - u32 (*get_tx_head)(int); - u32 (*get_tx_tail)(int); - void (*set_tx_head)(int, u32); - void (*set_tx_tail)(int, u32); - u8 __iomem * (*get_tx_buff)(int); - u32 (*get_tx_buff_size)(int); - u16 (*get_mask_req_ack)(int); - u16 (*get_mask_res_ack)(int); - u16 (*get_mask_send)(int); - - u32 (*get_rx_head)(int); - u32 (*get_rx_tail)(int); - void (*set_rx_head)(int, u32); - void (*set_rx_tail)(int, u32); - u8 __iomem * (*get_rx_buff)(int); - u32 (*get_rx_buff_size)(int); - - void (*log_disp)(struct modemlink_dpram_control *dpctl); - int (*cpupload_step1)(struct modemlink_dpram_control *dpctl); - int (*cpupload_step2)(void *arg, struct modemlink_dpram_control *dpctl); - int (*cpimage_load_prepare)(struct modemlink_dpram_control *dpctl); - int (*cpimage_load)(void *arg, struct modemlink_dpram_control *dpctl); - int (*nvdata_load)(void *arg, struct modemlink_dpram_control *dpctl); - int (*phone_boot_start)(struct modemlink_dpram_control *dpctl); - int (*phone_boot_start_post_process)(void); - void (*phone_boot_start_handler)(struct modemlink_dpram_control *dpctl); - void (*dload_cmd_hdlr)( - struct modemlink_dpram_control *dpctl, u16 cmd); - void (*bt_map_init)(struct modemlink_dpram_control *dpctl); - void (*load_init)(struct modemlink_dpram_control *dpctl); -#if defined(CONFIG_MACH_M0_CTC) - void (*terminate_link)(struct modemlink_dpram_control *dpctl); -#endif - u8 __iomem *dp_base; - u32 dp_size; - enum dpram_type dp_type; /* DPRAM type */ - int aligned; /* If aligned access is required, ... */ + int (*wakeup)(void); + void (*sleep)(void); - int dpram_irq; - unsigned long dpram_irq_flags; - char *dpram_irq_name; - char *dpram_wlock_name; + void (*setup_speed)(enum dpram_speed); - int max_ipc_dev; + enum dpram_type dp_type; /* DPRAM type */ + int aligned; /* aligned access is required */ + u8 __iomem *dp_base; + u32 dp_size; + int dpram_irq; + unsigned long dpram_irq_flags; + + int max_ipc_dev; struct dpram_ipc_map *ipc_map; -}; -#define DPRAM_MAGIC_CODE 0xAA + unsigned boot_size_offset; + unsigned boot_tag_offset; + unsigned boot_count_offset; + unsigned max_boot_frame_size; +}; /* platform data */ struct modem_data { @@ -255,10 +253,22 @@ struct modem_data { #endif unsigned gpio_cp_warm_reset; unsigned gpio_sim_detect; -#ifdef CONFIG_LINK_DEVICE_DPRAM +#if defined(CONFIG_LINK_DEVICE_DPRAM) || defined(CONFIG_LINK_DEVICE_PLD) unsigned gpio_dpram_int; #endif +#ifdef CONFIG_LINK_DEVICE_PLD + unsigned gpio_fpga1_creset; + unsigned gpio_fpga1_cdone; + unsigned gpio_fpga1_rst_n; + unsigned gpio_fpga1_cs_n; + + unsigned gpio_fpga2_creset; + unsigned gpio_fpga2_cdone; + unsigned gpio_fpga2_rst_n; + unsigned gpio_fpga2_cs_n; +#endif + #ifdef CONFIG_LTE_MODEM_CMC221 unsigned gpio_dpram_status; unsigned gpio_dpram_wakeup; @@ -275,6 +285,21 @@ struct modem_data { struct regulator *cp_vbus; #endif +#ifdef CONFIG_TDSCDMA_MODEM_SPRD8803 + unsigned gpio_ipc_mrdy; + unsigned gpio_ipc_srdy; + unsigned gpio_ipc_sub_mrdy; + unsigned gpio_ipc_sub_srdy; + unsigned gpio_ap_cp_int1; + unsigned gpio_ap_cp_int2; +#endif + +#ifdef CONFIG_SEC_DUAL_MODEM_MODE + unsigned gpio_sim_io_sel; + unsigned gpio_cp_ctrl1; + unsigned gpio_cp_ctrl2; +#endif + /* Switch with 2 links in a modem */ unsigned gpio_dynamic_switching; @@ -283,7 +308,7 @@ struct modem_data { enum modem_t modem_type; enum modem_link link_types; char *link_name; -#ifdef CONFIG_LINK_DEVICE_DPRAM +#if defined(CONFIG_LINK_DEVICE_DPRAM) || defined(CONFIG_LINK_DEVICE_PLD) /* Link to DPRAM control functions dependent on each platform */ struct modemlink_dpram_control *dpram_ctl; #endif @@ -306,6 +331,8 @@ struct modem_data { /* Debugging option */ bool use_mif_log; + /* SIM Detect polarity */ + bool sim_polarity; }; #define LOG_TAG "mif: " diff --git a/include/linux/platform_data/modem_na.h b/include/linux/platform_data/modem_na.h new file mode 100644 index 0000000..1fafcdb --- /dev/null +++ b/include/linux/platform_data/modem_na.h @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2010 Google, Inc. + * Copyright (C) 2010 Samsung Electronics. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __MODEM_IF_H__ +#define __MODEM_IF_H__ + +enum modem_t { + IMC_XMM6260, + VIA_CBP71, + SEC_CMC221, + SEC_CMC220, +}; + +enum dev_format { + IPC_FMT, + IPC_RAW, + IPC_RFS, + IPC_CMD, + IPC_BOOT, + IPC_MULTI_RAW, + IPC_RAMDUMP, +}; + +enum modem_io { + IODEV_MISC, + IODEV_NET, + IODEV_DUMMY, +}; + +enum modem_link { + LINKDEV_MIPI, + LINKDEV_DPRAM, + LINKDEV_SPI, + LINKDEV_USB, + LINKDEV_MAX, +}; + +enum modem_network { + UMTS_NETWORK, + CDMA_NETWORK, + LTE_NETWORK, +}; + +/* This structure is used in board-tuna-modem.c */ +struct modem_io_t { + char *name; + int id; + enum dev_format format; + enum modem_io io_type; + enum modem_link link; +}; + +struct modemlink_pm_data { + char *name; + /* link power contol 2 types : pin & regulator control */ + int (*link_ldo_enable)(bool); + unsigned gpio_link_enable; + unsigned gpio_link_active; + unsigned gpio_link_hostwake; + unsigned gpio_link_slavewake; + int (*link_reconnect)(void); + int (*port_enable)(int, int); + int *p_hub_status; + bool has_usbhub; + + atomic_t freqlock; + int (*cpufreq_lock)(void); + int (*cpufreq_unlock)(void); + + int autosuspend_delay_ms; /* if zero, the default value is used */ +}; + +struct modemlink_pm_link_activectl { + int gpio_initialized; + int gpio_request_host_active; +}; + +/* dpram specific struct */ +struct modemlink_shared_channel { + char *name; + unsigned out_offset; + unsigned out_size; + unsigned in_offset; + unsigned in_size; +}; + +struct modemlink_memmap { + unsigned magic_offset; + unsigned magic_size; + unsigned access_offset; + unsigned access_size; + unsigned in_box_offset; + unsigned in_box_size; + unsigned out_box_offset; + unsigned out_box_size; + + unsigned num_shared_map; + struct modemlink_shared_channel *shared_map; + + /*for interanl dpram interrupt clear*/ + void (*vendor_clear_irq)(void); + int (*board_ota_reset)(void); +}; + +/* platform data */ +struct modem_data { + char *name; + + unsigned gpio_cp_on; + unsigned gpio_cp_off; + unsigned gpio_reset_req_n; + unsigned gpio_cp_reset; + unsigned gpio_pda_active; + unsigned gpio_phone_active; + unsigned gpio_cp_dump_int; + unsigned gpio_flm_uart_sel; + unsigned gpio_cp_warm_reset; + unsigned gpio_ap_wakeup; +#if defined(CONFIG_LTE_MODEM_CMC221) || defined(CONFIG_LTE_MODEM_CMC220) + unsigned gpio_slave_wakeup; + unsigned gpio_host_wakeup; + unsigned gpio_host_active; + int irq_host_wakeup; +#endif + /* modem component */ + enum modem_t modem_type; + enum modem_link link_type; + enum modem_network modem_net; + unsigned num_iodevs; + struct modem_io_t *iodevs; + void *modemlink_extension; + void (*clear_intr)(void); + int (*ota_reset)(void); +#ifdef CONFIG_INTERNAL_MODEM_IF + void (*sfr_init)(void); + unsigned gpio_mbx_intr; +#endif + + /* Modem link PM support */ + struct modemlink_pm_data *link_pm_data; + /* Align mit mask used to adjust IPC RAW and MULTI_RAW HDLC + Packets from interndal dpram */ + unsigned char align; +}; + +/* DEBUG */ +#define LOG_TAG "mif: " + +#define mif_err(fmt, ...) \ + pr_err(LOG_TAG "%s: " pr_fmt(fmt), __func__, ##__VA_ARGS__) +#define mif_debug(fmt, ...) \ + pr_debug(LOG_TAG "%s: " pr_fmt(fmt), __func__, ##__VA_ARGS__) +#define mif_info(fmt, ...) \ + pr_info(LOG_TAG "%s: " pr_fmt(fmt), __func__, ##__VA_ARGS__) +#define mif_trace(fmt, ...) \ + printk(KERN_DEBUG "mif: %s: %d: called(%pF): " fmt, \ + __func__, __LINE__, __builtin_return_address(0), ##__VA_ARGS__) + +#endif diff --git a/include/linux/platform_data/usb3503_otg_conn.h b/include/linux/platform_data/usb3503_otg_conn.h new file mode 100644 index 0000000..224a87e --- /dev/null +++ b/include/linux/platform_data/usb3503_otg_conn.h @@ -0,0 +1,22 @@ +#ifndef USB3503_H +#define USB3503_H + +#define USB3503_I2C_NAME "usb3503" +int usb3503_set_mode(int mode); + +enum { + USB_3503_MODE_HUB = 0, + USB_3503_MODE_STANDBY = 1, +}; + +struct usb3503_platform_data { + bool init_needed; + bool es_ver; + char inital_mode; + int (*hw_config)(void); + int (*reset_n)(int); + int (*port_enable)(int, int); +}; + +#endif + |