diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dmi.h | 47 | ||||
-rw-r--r-- | include/linux/dynamic_debug.h | 8 | ||||
-rw-r--r-- | include/linux/efi.h | 37 | ||||
-rw-r--r-- | include/linux/firmware.h | 4 | ||||
-rw-r--r-- | include/linux/kobject.h | 10 | ||||
-rw-r--r-- | include/linux/memory.h | 3 | ||||
-rw-r--r-- | include/linux/node.h | 6 | ||||
-rw-r--r-- | include/linux/platform_data/uio_pruss.h | 25 | ||||
-rw-r--r-- | include/linux/platform_device.h | 11 | ||||
-rw-r--r-- | include/linux/ti_wilink_st.h | 76 |
10 files changed, 188 insertions, 39 deletions
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 90e087f8d95..f156cca25ad 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -23,6 +23,53 @@ enum dmi_device_type { | |||
23 | DMI_DEV_TYPE_DEV_ONBOARD = -3, | 23 | DMI_DEV_TYPE_DEV_ONBOARD = -3, |
24 | }; | 24 | }; |
25 | 25 | ||
26 | enum dmi_entry_type { | ||
27 | DMI_ENTRY_BIOS = 0, | ||
28 | DMI_ENTRY_SYSTEM, | ||
29 | DMI_ENTRY_BASEBOARD, | ||
30 | DMI_ENTRY_CHASSIS, | ||
31 | DMI_ENTRY_PROCESSOR, | ||
32 | DMI_ENTRY_MEM_CONTROLLER, | ||
33 | DMI_ENTRY_MEM_MODULE, | ||
34 | DMI_ENTRY_CACHE, | ||
35 | DMI_ENTRY_PORT_CONNECTOR, | ||
36 | DMI_ENTRY_SYSTEM_SLOT, | ||
37 | DMI_ENTRY_ONBOARD_DEVICE, | ||
38 | DMI_ENTRY_OEMSTRINGS, | ||
39 | DMI_ENTRY_SYSCONF, | ||
40 | DMI_ENTRY_BIOS_LANG, | ||
41 | DMI_ENTRY_GROUP_ASSOC, | ||
42 | DMI_ENTRY_SYSTEM_EVENT_LOG, | ||
43 | DMI_ENTRY_PHYS_MEM_ARRAY, | ||
44 | DMI_ENTRY_MEM_DEVICE, | ||
45 | DMI_ENTRY_32_MEM_ERROR, | ||
46 | DMI_ENTRY_MEM_ARRAY_MAPPED_ADDR, | ||
47 | DMI_ENTRY_MEM_DEV_MAPPED_ADDR, | ||
48 | DMI_ENTRY_BUILTIN_POINTING_DEV, | ||
49 | DMI_ENTRY_PORTABLE_BATTERY, | ||
50 | DMI_ENTRY_SYSTEM_RESET, | ||
51 | DMI_ENTRY_HW_SECURITY, | ||
52 | DMI_ENTRY_SYSTEM_POWER_CONTROLS, | ||
53 | DMI_ENTRY_VOLTAGE_PROBE, | ||
54 | DMI_ENTRY_COOLING_DEV, | ||
55 | DMI_ENTRY_TEMP_PROBE, | ||
56 | DMI_ENTRY_ELECTRICAL_CURRENT_PROBE, | ||
57 | DMI_ENTRY_OOB_REMOTE_ACCESS, | ||
58 | DMI_ENTRY_BIS_ENTRY, | ||
59 | DMI_ENTRY_SYSTEM_BOOT, | ||
60 | DMI_ENTRY_MGMT_DEV, | ||
61 | DMI_ENTRY_MGMT_DEV_COMPONENT, | ||
62 | DMI_ENTRY_MGMT_DEV_THRES, | ||
63 | DMI_ENTRY_MEM_CHANNEL, | ||
64 | DMI_ENTRY_IPMI_DEV, | ||
65 | DMI_ENTRY_SYS_POWER_SUPPLY, | ||
66 | DMI_ENTRY_ADDITIONAL, | ||
67 | DMI_ENTRY_ONBOARD_DEV_EXT, | ||
68 | DMI_ENTRY_MGMT_CONTROLLER_HOST, | ||
69 | DMI_ENTRY_INACTIVE = 126, | ||
70 | DMI_ENTRY_END_OF_TABLE = 127, | ||
71 | }; | ||
72 | |||
26 | struct dmi_header { | 73 | struct dmi_header { |
27 | u8 type; | 74 | u8 type; |
28 | u8 length; | 75 | u8 length; |
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 1c70028f81f..0c9653f11c1 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
@@ -31,6 +31,10 @@ struct _ddebug { | |||
31 | * writes commands to <debugfs>/dynamic_debug/control | 31 | * writes commands to <debugfs>/dynamic_debug/control |
32 | */ | 32 | */ |
33 | #define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */ | 33 | #define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */ |
34 | #define _DPRINTK_FLAGS_INCL_MODNAME (1<<1) | ||
35 | #define _DPRINTK_FLAGS_INCL_FUNCNAME (1<<2) | ||
36 | #define _DPRINTK_FLAGS_INCL_LINENO (1<<3) | ||
37 | #define _DPRINTK_FLAGS_INCL_TID (1<<4) | ||
34 | #define _DPRINTK_FLAGS_DEFAULT 0 | 38 | #define _DPRINTK_FLAGS_DEFAULT 0 |
35 | unsigned int flags:8; | 39 | unsigned int flags:8; |
36 | char enabled; | 40 | char enabled; |
@@ -42,6 +46,8 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n, | |||
42 | 46 | ||
43 | #if defined(CONFIG_DYNAMIC_DEBUG) | 47 | #if defined(CONFIG_DYNAMIC_DEBUG) |
44 | extern int ddebug_remove_module(const char *mod_name); | 48 | extern int ddebug_remove_module(const char *mod_name); |
49 | extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...) | ||
50 | __attribute__ ((format (printf, 2, 3))); | ||
45 | 51 | ||
46 | #define dynamic_pr_debug(fmt, ...) do { \ | 52 | #define dynamic_pr_debug(fmt, ...) do { \ |
47 | static struct _ddebug descriptor \ | 53 | static struct _ddebug descriptor \ |
@@ -50,7 +56,7 @@ extern int ddebug_remove_module(const char *mod_name); | |||
50 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ | 56 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ |
51 | _DPRINTK_FLAGS_DEFAULT }; \ | 57 | _DPRINTK_FLAGS_DEFAULT }; \ |
52 | if (unlikely(descriptor.enabled)) \ | 58 | if (unlikely(descriptor.enabled)) \ |
53 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ | 59 | __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \ |
54 | } while (0) | 60 | } while (0) |
55 | 61 | ||
56 | 62 | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index fb737bc19a8..33fa1203024 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -397,4 +397,41 @@ static inline void memrange_efi_to_native(u64 *addr, u64 *npages) | |||
397 | *addr &= PAGE_MASK; | 397 | *addr &= PAGE_MASK; |
398 | } | 398 | } |
399 | 399 | ||
400 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | ||
401 | /* | ||
402 | * EFI Variable support. | ||
403 | * | ||
404 | * Different firmware drivers can expose their EFI-like variables using | ||
405 | * the following. | ||
406 | */ | ||
407 | |||
408 | struct efivar_operations { | ||
409 | efi_get_variable_t *get_variable; | ||
410 | efi_get_next_variable_t *get_next_variable; | ||
411 | efi_set_variable_t *set_variable; | ||
412 | }; | ||
413 | |||
414 | struct efivars { | ||
415 | /* | ||
416 | * ->lock protects two things: | ||
417 | * 1) ->list - adds, removals, reads, writes | ||
418 | * 2) ops.[gs]et_variable() calls. | ||
419 | * It must not be held when creating sysfs entries or calling kmalloc. | ||
420 | * ops.get_next_variable() is only called from register_efivars(), | ||
421 | * which is protected by the BKL, so that path is safe. | ||
422 | */ | ||
423 | spinlock_t lock; | ||
424 | struct list_head list; | ||
425 | struct kset *kset; | ||
426 | struct bin_attribute *new_var, *del_var; | ||
427 | const struct efivar_operations *ops; | ||
428 | }; | ||
429 | |||
430 | int register_efivars(struct efivars *efivars, | ||
431 | const struct efivar_operations *ops, | ||
432 | struct kobject *parent_kobj); | ||
433 | void unregister_efivars(struct efivars *efivars); | ||
434 | |||
435 | #endif /* CONFIG_EFI_VARS */ | ||
436 | |||
400 | #endif /* _LINUX_EFI_H */ | 437 | #endif /* _LINUX_EFI_H */ |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 53d1e6c4f84..21b3e7588ab 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -39,7 +39,7 @@ struct builtin_fw { | |||
39 | int request_firmware(const struct firmware **fw, const char *name, | 39 | int request_firmware(const struct firmware **fw, const char *name, |
40 | struct device *device); | 40 | struct device *device); |
41 | int request_firmware_nowait( | 41 | int request_firmware_nowait( |
42 | struct module *module, int uevent, | 42 | struct module *module, bool uevent, |
43 | const char *name, struct device *device, gfp_t gfp, void *context, | 43 | const char *name, struct device *device, gfp_t gfp, void *context, |
44 | void (*cont)(const struct firmware *fw, void *context)); | 44 | void (*cont)(const struct firmware *fw, void *context)); |
45 | 45 | ||
@@ -52,7 +52,7 @@ static inline int request_firmware(const struct firmware **fw, | |||
52 | return -EINVAL; | 52 | return -EINVAL; |
53 | } | 53 | } |
54 | static inline int request_firmware_nowait( | 54 | static inline int request_firmware_nowait( |
55 | struct module *module, int uevent, | 55 | struct module *module, bool uevent, |
56 | const char *name, struct device *device, gfp_t gfp, void *context, | 56 | const char *name, struct device *device, gfp_t gfp, void *context, |
57 | void (*cont)(const struct firmware *fw, void *context)) | 57 | void (*cont)(const struct firmware *fw, void *context)) |
58 | { | 58 | { |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 8f6d1215104..9229b64ee3a 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -85,11 +85,13 @@ static inline const char *kobject_name(const struct kobject *kobj) | |||
85 | extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); | 85 | extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); |
86 | extern int __must_check kobject_add(struct kobject *kobj, | 86 | extern int __must_check kobject_add(struct kobject *kobj, |
87 | struct kobject *parent, | 87 | struct kobject *parent, |
88 | const char *fmt, ...); | 88 | const char *fmt, ...) |
89 | __attribute__((format(printf, 3, 4))); | ||
89 | extern int __must_check kobject_init_and_add(struct kobject *kobj, | 90 | extern int __must_check kobject_init_and_add(struct kobject *kobj, |
90 | struct kobj_type *ktype, | 91 | struct kobj_type *ktype, |
91 | struct kobject *parent, | 92 | struct kobject *parent, |
92 | const char *fmt, ...); | 93 | const char *fmt, ...) |
94 | __attribute__((format(printf, 4, 5))); | ||
93 | 95 | ||
94 | extern void kobject_del(struct kobject *kobj); | 96 | extern void kobject_del(struct kobject *kobj); |
95 | 97 | ||
@@ -224,8 +226,8 @@ static inline int kobject_uevent_env(struct kobject *kobj, | |||
224 | char *envp[]) | 226 | char *envp[]) |
225 | { return 0; } | 227 | { return 0; } |
226 | 228 | ||
227 | static inline int add_uevent_var(struct kobj_uevent_env *env, | 229 | static inline __attribute__((format(printf, 2, 3))) |
228 | const char *format, ...) | 230 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) |
229 | { return 0; } | 231 | { return 0; } |
230 | 232 | ||
231 | static inline int kobject_action_type(const char *buf, size_t count, | 233 | static inline int kobject_action_type(const char *buf, size_t count, |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 06c1fa0a5c7..e1e3b2b84f8 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -21,7 +21,8 @@ | |||
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | 22 | ||
23 | struct memory_block { | 23 | struct memory_block { |
24 | unsigned long phys_index; | 24 | unsigned long start_section_nr; |
25 | unsigned long end_section_nr; | ||
25 | unsigned long state; | 26 | unsigned long state; |
26 | int section_count; | 27 | int section_count; |
27 | 28 | ||
diff --git a/include/linux/node.h b/include/linux/node.h index 1466945cc9e..92370e22343 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
@@ -39,7 +39,8 @@ extern int register_cpu_under_node(unsigned int cpu, unsigned int nid); | |||
39 | extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); | 39 | extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); |
40 | extern int register_mem_sect_under_node(struct memory_block *mem_blk, | 40 | extern int register_mem_sect_under_node(struct memory_block *mem_blk, |
41 | int nid); | 41 | int nid); |
42 | extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk); | 42 | extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk, |
43 | unsigned long phys_index); | ||
43 | 44 | ||
44 | #ifdef CONFIG_HUGETLBFS | 45 | #ifdef CONFIG_HUGETLBFS |
45 | extern void register_hugetlbfs_with_node(node_registration_func_t doregister, | 46 | extern void register_hugetlbfs_with_node(node_registration_func_t doregister, |
@@ -67,7 +68,8 @@ static inline int register_mem_sect_under_node(struct memory_block *mem_blk, | |||
67 | { | 68 | { |
68 | return 0; | 69 | return 0; |
69 | } | 70 | } |
70 | static inline int unregister_mem_sect_under_nodes(struct memory_block *mem_blk) | 71 | static inline int unregister_mem_sect_under_nodes(struct memory_block *mem_blk, |
72 | unsigned long phys_index) | ||
71 | { | 73 | { |
72 | return 0; | 74 | return 0; |
73 | } | 75 | } |
diff --git a/include/linux/platform_data/uio_pruss.h b/include/linux/platform_data/uio_pruss.h new file mode 100644 index 00000000000..f39140aabc6 --- /dev/null +++ b/include/linux/platform_data/uio_pruss.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * include/linux/platform_data/uio_pruss.h | ||
3 | * | ||
4 | * Platform data for uio_pruss driver | ||
5 | * | ||
6 | * Copyright (C) 2010-11 Texas Instruments Incorporated - http://www.ti.com/ | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License as | ||
10 | * published by the Free Software Foundation version 2. | ||
11 | * | ||
12 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
13 | * kind, whether express or implied; without even the implied warranty | ||
14 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | */ | ||
17 | |||
18 | #ifndef _UIO_PRUSS_H_ | ||
19 | #define _UIO_PRUSS_H_ | ||
20 | |||
21 | /* To configure the PRUSS INTC base offset for UIO driver */ | ||
22 | struct uio_pruss_pdata { | ||
23 | u32 pintc_base; | ||
24 | }; | ||
25 | #endif /* _UIO_PRUSS_H_ */ | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 2e700ec0601..d96db982570 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -130,8 +130,15 @@ extern void platform_driver_unregister(struct platform_driver *); | |||
130 | extern int platform_driver_probe(struct platform_driver *driver, | 130 | extern int platform_driver_probe(struct platform_driver *driver, |
131 | int (*probe)(struct platform_device *)); | 131 | int (*probe)(struct platform_device *)); |
132 | 132 | ||
133 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) | 133 | static inline void *platform_get_drvdata(const struct platform_device *pdev) |
134 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) | 134 | { |
135 | return dev_get_drvdata(&pdev->dev); | ||
136 | } | ||
137 | |||
138 | static inline void platform_set_drvdata(struct platform_device *pdev, void *data) | ||
139 | { | ||
140 | dev_set_drvdata(&pdev->dev, data); | ||
141 | } | ||
135 | 142 | ||
136 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, | 143 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, |
137 | int (*probe)(struct platform_device *), | 144 | int (*probe)(struct platform_device *), |
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h index 4c7be226301..7071ec5d011 100644 --- a/include/linux/ti_wilink_st.h +++ b/include/linux/ti_wilink_st.h | |||
@@ -26,15 +26,6 @@ | |||
26 | #define TI_WILINK_ST_H | 26 | #define TI_WILINK_ST_H |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW | ||
30 | * gpio states for their chip/core enable gpios | ||
31 | */ | ||
32 | enum kim_gpio_state { | ||
33 | KIM_GPIO_INACTIVE, | ||
34 | KIM_GPIO_ACTIVE, | ||
35 | }; | ||
36 | |||
37 | /** | ||
38 | * enum proto-type - The protocol on WiLink chips which share a | 29 | * enum proto-type - The protocol on WiLink chips which share a |
39 | * common physical interface like UART. | 30 | * common physical interface like UART. |
40 | */ | 31 | */ |
@@ -42,7 +33,7 @@ enum proto_type { | |||
42 | ST_BT, | 33 | ST_BT, |
43 | ST_FM, | 34 | ST_FM, |
44 | ST_GPS, | 35 | ST_GPS, |
45 | ST_MAX, | 36 | ST_MAX_CHANNELS = 16, |
46 | }; | 37 | }; |
47 | 38 | ||
48 | /** | 39 | /** |
@@ -62,6 +53,17 @@ enum proto_type { | |||
62 | * @priv_data: privdate data holder for the protocol drivers, sent | 53 | * @priv_data: privdate data holder for the protocol drivers, sent |
63 | * from the protocol drivers during registration, and sent back on | 54 | * from the protocol drivers during registration, and sent back on |
64 | * reg_complete_cb and recv. | 55 | * reg_complete_cb and recv. |
56 | * @chnl_id: channel id the protocol driver is interested in, the channel | ||
57 | * id is nothing but the 1st byte of the packet in UART frame. | ||
58 | * @max_frame_size: size of the largest frame the protocol can receive. | ||
59 | * @hdr_len: length of the header structure of the protocol. | ||
60 | * @offset_len_in_hdr: this provides the offset of the length field in the | ||
61 | * header structure of the protocol header, to assist ST to know | ||
62 | * how much to receive, if the data is split across UART frames. | ||
63 | * @len_size: whether the length field inside the header is 2 bytes | ||
64 | * or 1 byte. | ||
65 | * @reserve: the number of bytes ST needs to reserve in the skb being | ||
66 | * prepared for the protocol driver. | ||
65 | */ | 67 | */ |
66 | struct st_proto_s { | 68 | struct st_proto_s { |
67 | enum proto_type type; | 69 | enum proto_type type; |
@@ -70,10 +72,17 @@ struct st_proto_s { | |||
70 | void (*reg_complete_cb) (void *, char data); | 72 | void (*reg_complete_cb) (void *, char data); |
71 | long (*write) (struct sk_buff *skb); | 73 | long (*write) (struct sk_buff *skb); |
72 | void *priv_data; | 74 | void *priv_data; |
75 | |||
76 | unsigned char chnl_id; | ||
77 | unsigned short max_frame_size; | ||
78 | unsigned char hdr_len; | ||
79 | unsigned char offset_len_in_hdr; | ||
80 | unsigned char len_size; | ||
81 | unsigned char reserve; | ||
73 | }; | 82 | }; |
74 | 83 | ||
75 | extern long st_register(struct st_proto_s *); | 84 | extern long st_register(struct st_proto_s *); |
76 | extern long st_unregister(enum proto_type); | 85 | extern long st_unregister(struct st_proto_s *); |
77 | 86 | ||
78 | 87 | ||
79 | /* | 88 | /* |
@@ -114,6 +123,7 @@ extern long st_unregister(enum proto_type); | |||
114 | * @rx_skb: the skb where all data for a protocol gets accumulated, | 123 | * @rx_skb: the skb where all data for a protocol gets accumulated, |
115 | * since tty might not call receive when a complete event packet | 124 | * since tty might not call receive when a complete event packet |
116 | * is received, the states, count and the skb needs to be maintained. | 125 | * is received, the states, count and the skb needs to be maintained. |
126 | * @rx_chnl: the channel ID for which the data is getting accumalated for. | ||
117 | * @txq: the list of skbs which needs to be sent onto the TTY. | 127 | * @txq: the list of skbs which needs to be sent onto the TTY. |
118 | * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued | 128 | * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued |
119 | * up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs | 129 | * up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs |
@@ -135,10 +145,11 @@ struct st_data_s { | |||
135 | #define ST_TX_SENDING 1 | 145 | #define ST_TX_SENDING 1 |
136 | #define ST_TX_WAKEUP 2 | 146 | #define ST_TX_WAKEUP 2 |
137 | unsigned long tx_state; | 147 | unsigned long tx_state; |
138 | struct st_proto_s *list[ST_MAX]; | 148 | struct st_proto_s *list[ST_MAX_CHANNELS]; |
139 | unsigned long rx_state; | 149 | unsigned long rx_state; |
140 | unsigned long rx_count; | 150 | unsigned long rx_count; |
141 | struct sk_buff *rx_skb; | 151 | struct sk_buff *rx_skb; |
152 | unsigned char rx_chnl; | ||
142 | struct sk_buff_head txq, tx_waitq; | 153 | struct sk_buff_head txq, tx_waitq; |
143 | spinlock_t lock; | 154 | spinlock_t lock; |
144 | unsigned char protos_registered; | 155 | unsigned char protos_registered; |
@@ -146,6 +157,11 @@ struct st_data_s { | |||
146 | void *kim_data; | 157 | void *kim_data; |
147 | }; | 158 | }; |
148 | 159 | ||
160 | /* | ||
161 | * wrapper around tty->ops->write_room to check | ||
162 | * availability during firmware download | ||
163 | */ | ||
164 | int st_get_uart_wr_room(struct st_data_s *st_gdata); | ||
149 | /** | 165 | /** |
150 | * st_int_write - | 166 | * st_int_write - |
151 | * point this to tty->driver->write or tty->ops->write | 167 | * point this to tty->driver->write or tty->ops->write |
@@ -186,8 +202,9 @@ void gps_chrdrv_stub_init(void); | |||
186 | /* time in msec to wait for | 202 | /* time in msec to wait for |
187 | * line discipline to be installed | 203 | * line discipline to be installed |
188 | */ | 204 | */ |
189 | #define LDISC_TIME 500 | 205 | #define LDISC_TIME 1000 |
190 | #define CMD_RESP_TIME 500 | 206 | #define CMD_RESP_TIME 800 |
207 | #define CMD_WR_TIME 5000 | ||
191 | #define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \ | 208 | #define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \ |
192 | | ((unsigned short)((unsigned char)(b))) << 8)) | 209 | | ((unsigned short)((unsigned char)(b))) << 8)) |
193 | 210 | ||
@@ -210,6 +227,7 @@ struct chip_version { | |||
210 | unsigned short maj_ver; | 227 | unsigned short maj_ver; |
211 | }; | 228 | }; |
212 | 229 | ||
230 | #define UART_DEV_NAME_LEN 32 | ||
213 | /** | 231 | /** |
214 | * struct kim_data_s - the KIM internal data, embedded as the | 232 | * struct kim_data_s - the KIM internal data, embedded as the |
215 | * platform's drv data. One for each ST device in the system. | 233 | * platform's drv data. One for each ST device in the system. |
@@ -225,14 +243,11 @@ struct chip_version { | |||
225 | * the ldisc was properly installed. | 243 | * the ldisc was properly installed. |
226 | * @resp_buffer: data buffer for the .bts fw file name. | 244 | * @resp_buffer: data buffer for the .bts fw file name. |
227 | * @fw_entry: firmware class struct to request/release the fw. | 245 | * @fw_entry: firmware class struct to request/release the fw. |
228 | * @gpios: the list of core/chip enable gpios for BT, FM and GPS cores. | ||
229 | * @rx_state: the rx state for kim's receive func during fw download. | 246 | * @rx_state: the rx state for kim's receive func during fw download. |
230 | * @rx_count: the rx count for the kim's receive func during fw download. | 247 | * @rx_count: the rx count for the kim's receive func during fw download. |
231 | * @rx_skb: all of fw data might not come at once, and hence data storage for | 248 | * @rx_skb: all of fw data might not come at once, and hence data storage for |
232 | * whole of the fw response, only HCI_EVENTs and hence diff from ST's | 249 | * whole of the fw response, only HCI_EVENTs and hence diff from ST's |
233 | * response. | 250 | * response. |
234 | * @rfkill: rfkill data for each of the cores to be registered with rfkill. | ||
235 | * @rf_protos: proto types of the data registered with rfkill sub-system. | ||
236 | * @core_data: ST core's data, which mainly is the tty's disc_data | 251 | * @core_data: ST core's data, which mainly is the tty's disc_data |
237 | * @version: chip version available via a sysfs entry. | 252 | * @version: chip version available via a sysfs entry. |
238 | * | 253 | * |
@@ -243,14 +258,16 @@ struct kim_data_s { | |||
243 | struct completion kim_rcvd, ldisc_installed; | 258 | struct completion kim_rcvd, ldisc_installed; |
244 | char resp_buffer[30]; | 259 | char resp_buffer[30]; |
245 | const struct firmware *fw_entry; | 260 | const struct firmware *fw_entry; |
246 | long gpios[ST_MAX]; | 261 | long nshutdown; |
247 | unsigned long rx_state; | 262 | unsigned long rx_state; |
248 | unsigned long rx_count; | 263 | unsigned long rx_count; |
249 | struct sk_buff *rx_skb; | 264 | struct sk_buff *rx_skb; |
250 | struct rfkill *rfkill[ST_MAX]; | ||
251 | enum proto_type rf_protos[ST_MAX]; | ||
252 | struct st_data_s *core_data; | 265 | struct st_data_s *core_data; |
253 | struct chip_version version; | 266 | struct chip_version version; |
267 | unsigned char ldisc_install; | ||
268 | unsigned char dev_name[UART_DEV_NAME_LEN]; | ||
269 | unsigned char flow_cntrl; | ||
270 | unsigned long baud_rate; | ||
254 | }; | 271 | }; |
255 | 272 | ||
256 | /** | 273 | /** |
@@ -262,7 +279,6 @@ long st_kim_start(void *); | |||
262 | long st_kim_stop(void *); | 279 | long st_kim_stop(void *); |
263 | 280 | ||
264 | void st_kim_recv(void *, const unsigned char *, long count); | 281 | void st_kim_recv(void *, const unsigned char *, long count); |
265 | void st_kim_chip_toggle(enum proto_type, enum kim_gpio_state); | ||
266 | void st_kim_complete(void *); | 282 | void st_kim_complete(void *); |
267 | void kim_st_list_protocols(struct st_data_s *, void *); | 283 | void kim_st_list_protocols(struct st_data_s *, void *); |
268 | 284 | ||
@@ -338,12 +354,8 @@ struct hci_command { | |||
338 | 354 | ||
339 | /* ST LL receiver states */ | 355 | /* ST LL receiver states */ |
340 | #define ST_W4_PACKET_TYPE 0 | 356 | #define ST_W4_PACKET_TYPE 0 |
341 | #define ST_BT_W4_EVENT_HDR 1 | 357 | #define ST_W4_HEADER 1 |
342 | #define ST_BT_W4_ACL_HDR 2 | 358 | #define ST_W4_DATA 2 |
343 | #define ST_BT_W4_SCO_HDR 3 | ||
344 | #define ST_BT_W4_DATA 4 | ||
345 | #define ST_FM_W4_EVENT_HDR 5 | ||
346 | #define ST_GPS_W4_EVENT_HDR 6 | ||
347 | 359 | ||
348 | /* ST LL state machines */ | 360 | /* ST LL state machines */ |
349 | #define ST_LL_ASLEEP 0 | 361 | #define ST_LL_ASLEEP 0 |
@@ -397,4 +409,14 @@ struct gps_event_hdr { | |||
397 | u16 plen; | 409 | u16 plen; |
398 | } __attribute__ ((packed)); | 410 | } __attribute__ ((packed)); |
399 | 411 | ||
412 | /* platform data */ | ||
413 | struct ti_st_plat_data { | ||
414 | long nshutdown_gpio; | ||
415 | unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */ | ||
416 | unsigned char flow_cntrl; /* flow control flag */ | ||
417 | unsigned long baud_rate; | ||
418 | int (*suspend)(struct platform_device *, pm_message_t); | ||
419 | int (*resume)(struct platform_device *); | ||
420 | }; | ||
421 | |||
400 | #endif /* TI_WILINK_ST_H */ | 422 | #endif /* TI_WILINK_ST_H */ |