Commit ec60d0ad authored by Pavan Savoy's avatar Pavan Savoy Committed by Greg Kroah-Hartman

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: default avatarPavan Savoy <pavan_savoy@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5c88b021
What: /sys/devices/platform/kim/dev_name
Date: January 2010
KernelVersion: 2.6.38
Contact: "Pavan Savoy" <pavan_savoy@ti.com>
Description:
Name of the UART device at which the WL128x chip
is connected. example: "/dev/ttyS0".
The device name flows down to architecture specific board
initialization file from the SFI/ATAGS bootloader
firmware. The name exposed is read from the user-space
dameon and opens the device when install is requested.
What: /sys/devices/platform/kim/baud_rate
Date: January 2010
KernelVersion: 2.6.38
Contact: "Pavan Savoy" <pavan_savoy@ti.com>
Description:
The maximum reliable baud-rate the host can support.
Different platforms tend to have different high-speed
UART configurations, so the baud-rate needs to be set
locally and also sent across to the WL128x via a HCI-VS
command. The entry is read and made use by the user-space
daemon when the ldisc install is requested.
What: /sys/devices/platform/kim/flow_cntrl
Date: January 2010
KernelVersion: 2.6.38
Contact: "Pavan Savoy" <pavan_savoy@ti.com>
Description:
The WL128x makes use of flow control mechanism, and this
entry most often should be 1, the host's UART is required
to have the capability of flow-control, or else this
entry can be made use of for exceptions.
What: /sys/devices/platform/kim/install
Date: January 2010
KernelVersion: 2.6.38
Contact: "Pavan Savoy" <pavan_savoy@ti.com>
Description:
When one of the protocols Bluetooth, FM or GPS wants to make
use of the shared UART transport, it registers to the shared
transport driver, which will signal the user-space for opening,
configuring baud and install line discipline via this sysfs
entry. This entry would be polled upon by the user-space
daemon managing the UART, and is notified about the change
by the sysfs_notify. The value would be '1' when UART needs
to be opened/ldisc installed, and would be '0' when UART
is no more required and needs to be closed.
This diff is collapsed.
...@@ -206,8 +206,8 @@ void gps_chrdrv_stub_init(void); ...@@ -206,8 +206,8 @@ void gps_chrdrv_stub_init(void);
/* time in msec to wait for /* time in msec to wait for
* line discipline to be installed * line discipline to be installed
*/ */
#define LDISC_TIME 500 #define LDISC_TIME 1000
#define CMD_RESP_TIME 500 #define CMD_RESP_TIME 800
#define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \ #define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \
| ((unsigned short)((unsigned char)(b))) << 8)) | ((unsigned short)((unsigned char)(b))) << 8))
...@@ -230,6 +230,7 @@ struct chip_version { ...@@ -230,6 +230,7 @@ struct chip_version {
unsigned short maj_ver; unsigned short maj_ver;
}; };
#define UART_DEV_NAME_LEN 32
/** /**
* struct kim_data_s - the KIM internal data, embedded as the * struct kim_data_s - the KIM internal data, embedded as the
* platform's drv data. One for each ST device in the system. * platform's drv data. One for each ST device in the system.
...@@ -271,6 +272,10 @@ struct kim_data_s { ...@@ -271,6 +272,10 @@ struct kim_data_s {
enum proto_type rf_protos[ST_MAX_CHANNELS]; enum proto_type rf_protos[ST_MAX_CHANNELS];
struct st_data_s *core_data; struct st_data_s *core_data;
struct chip_version version; 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 { ...@@ -413,4 +418,14 @@ struct gps_event_hdr {
u16 plen; u16 plen;
} __attribute__ ((packed)); } __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 */ #endif /* TI_WILINK_ST_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment