drivers:misc: ti-st: move from rfkill to sysfs
The communication between ST KIM and UIM was interfaced over the /dev/rfkill device node. Move the interface to a simpler less abusive sysfs entry mechanism and document it in Documentation/ABI/testing/ under sysfs-platform-kim. Shared transport driver would now read the UART details originally received by bootloader or firmware as platform data. The data read will be shared over sysfs entries for the user-space UIM or other n/w manager/plugins to be read, and assist the driver by opening up the UART, setting the baud-rate and installing the line discipline. Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
5c88b02196
commit
ec60d0ad20
3 changed files with 187 additions and 126 deletions
|
@ -206,8 +206,8 @@ void gps_chrdrv_stub_init(void);
|
|||
/* time in msec to wait for
|
||||
* line discipline to be installed
|
||||
*/
|
||||
#define LDISC_TIME 500
|
||||
#define CMD_RESP_TIME 500
|
||||
#define LDISC_TIME 1000
|
||||
#define CMD_RESP_TIME 800
|
||||
#define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \
|
||||
| ((unsigned short)((unsigned char)(b))) << 8))
|
||||
|
||||
|
@ -230,6 +230,7 @@ struct chip_version {
|
|||
unsigned short maj_ver;
|
||||
};
|
||||
|
||||
#define UART_DEV_NAME_LEN 32
|
||||
/**
|
||||
* struct kim_data_s - the KIM internal data, embedded as the
|
||||
* platform's drv data. One for each ST device in the system.
|
||||
|
@ -271,6 +272,10 @@ struct kim_data_s {
|
|||
enum proto_type rf_protos[ST_MAX_CHANNELS];
|
||||
struct st_data_s *core_data;
|
||||
struct chip_version version;
|
||||
unsigned char ldisc_install;
|
||||
unsigned char dev_name[UART_DEV_NAME_LEN];
|
||||
unsigned char flow_cntrl;
|
||||
unsigned long baud_rate;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -413,4 +418,14 @@ struct gps_event_hdr {
|
|||
u16 plen;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* platform data */
|
||||
struct ti_st_plat_data {
|
||||
long gpios[ST_MAX_CHANNELS]; /* BT, FM and GPS */
|
||||
unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */
|
||||
unsigned char flow_cntrl; /* flow control flag */
|
||||
unsigned long baud_rate;
|
||||
int (*suspend)(struct platform_device *, pm_message_t);
|
||||
int (*resume)(struct platform_device *);
|
||||
};
|
||||
|
||||
#endif /* TI_WILINK_ST_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue