drivers:staging:ti-st: mv sysfs entries to debugfs
PATCH 1/2 drivers:staging:ti-st: mv sysfs entries to debugfs
From: Pavan Savoy <[email protected]>
When the chip is in use, information like the chip's ROM version and the protocols currently making use of the chip needs to be made known to user-space.
Earlier the version and the protocol-list were exposed as sysfs entries now cleanup by making them as debugfs entries, also in process remove any unwanted/previously unused sysfs entries.
Signed-off-by Pavan Savoy <[email protected]>
--- drivers/staging/ti-st/st_core.c | 27 +--------- drivers/staging/ti-st/st_kim.c | 114 ++++++++++++++++---------------------- drivers/staging/ti-st/st_kim.h | 2 +- 3 files changed, 51 insertions(+), 92 deletions(-)
drivers/staging/ti-st/st_core.c +2 -25
@@ -39,7 +39,6 @@#include "st.h" #define VERBOSE -#ifdef DEBUG /* strings to be used for rfkill entries and by * ST Core to be used for sysfs debug entry */
@@ -49,7 +48,6 @@ const unsigned char *protocol_strngs[] = {PROTO_ENTRY (ST_FM ,"FM" ), PROTO_ENTRY(ST_GPS, "GPS"), }; -#endif /* function pointer pointing to either, * st_kim_recv during registration to receive fw download responses * st_int_recv after registration to receive proto stack responses
@@ -563,34 +561,13 @@ void st_tx_wakeup(struct st_data_s *st_data)/********************************************************************/ /* functions called from ST KIM */ -void kim_st_list_protocols (struct st_data_s *st_gdata,char *buf) +void kim_st_list_protocols (struct st_data_s *st_gdata,void *buf) { -unsigned long flags =0 ; -#ifdef DEBUG -unsigned char i =ST_MAX ; -#endif -spin_lock_irqsave (&st_gdata->lock, flags); -#ifdef DEBUG /* more detailed log */ -for (i =0 ; i <ST_MAX ; i++) { -if (i ==0 ) { -sprintf (buf,"%s is %s" , protocol_strngs[i], - st_gdata->list[i] != -NULL ?"Registered" :"Unregistered" ); - }else { -sprintf (buf,"%s\n%s is %s" , buf, protocol_strngs[i], - st_gdata->list[i] != -NULL ?"Registered" :"Unregistered" ); - } - } -sprintf (buf,"%s\n" , buf); -#else /* limited info */ -sprintf (buf,"[%d]\nBT=%c\nFM=%c\nGPS=%c\n" , +seq_printf (buf,"[%d]\nBT=%c\nFM=%c\nGPS=%c\n" , st_gdata->protos_registered, st_gdata->list[ST_BT ] !=NULL ?'R' :'U' , st_gdata->list[ST_FM ] !=NULL ?'R' :'U' , st_gdata->list[ST_GPS ] !=NULL ?'R' :'U' ); -#endif -spin_unlock_irqrestore (&st_gdata->lock, flags); }/********************************************************************/
drivers/staging/ti-st/st_kim.c +48 -66
165 lines not on this page · raw message
drivers/staging/ti-st/st_kim.h +1 -1
@@ -108,7 +108,7 @@ long st_kim_stop(void *);void st_kim_recv (void *,const unsigned char *,long count);void st_kim_chip_toggle (enum proto_type ,enum kim_gpio_state );void st_kim_complete (void *); -void kim_st_list_protocols (struct st_data_s *,char *); +void kim_st_list_protocols (struct st_data_s *,void *);/* * BTS headers
Signature · 1 line
1.5.6.3
PATCH 2/2 drivers:staging:ti-st: update ABI and TODO
From: Pavan Savoy <[email protected]>
update TODO to reflect the items taken care of, update ABI to reflect the new debugfs entries exposed.
Signed-off-by Pavan Savoy <[email protected]>
--- drivers/staging/ti-st/TODO | 10 +++------- drivers/staging/ti-st/sysfs-uim | 12 ++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-)
drivers/staging/ti-st/TODO +3 -7
@@ -11,16 +11,12 @@ a st_register() would know whether the registration from BT/FM or GPS was intend 2. Improve upon the way requirement of line discipline is communicated to user-space, The current user-space application which open/installs ldisc as and when required can be found at, -http://git.omapzoom.org/?p�atform/hardware/ti/omap3.git;a�ob;f�_st/uim/uim.c;ha16c2c2b5085eb54a1bbc7096d779d7594eb11;hb�lair +http://dev.omapzoom.org/pub/scm/jsistla/L23-btfm.git +branch: UIM 3. Re-view/Re-work on the locking. -4. Re-structure to make the ldisc driver more generic for chipsets which mux -multiple connectivity (BT, FM, GPS) upon 1 TTY port. - -5. Remove global references by providing a context which can be moved around the driver like the other ldisc drivers. (ldiscs tend to use tty's disc_data and platform devices use the device's driver data) - -6. Step up and maintain this driver to ensure that it continues +4. Step up and maintain this driver to ensure that it continues to work. Having the hardware for this is pretty much a requirement. If this does not happen, the will be removed in the 2.6.35 kernel release.
drivers/staging/ti-st/sysfs-uim +12 -0
@@ -14,3 +14,15 @@ Description: uninstallation would be ppolling on this device and listening on events which would suggest either to install or un-install line discipline + +What: /sys/kernel/debug/ti-st/version +Contact: Pavan Savoy <[email protected]> +Description: + WiLink chip's ROM version exposed to user-space for some + proprietary protocol stacks to make use of. + +What: /sys/kernel/debug/ti-st/protocols +Contact: Pavan Savoy <[email protected]> +Description: + The reason for chip being ON, the list of protocols registered. +
Signature · 1 line
1.5.6.3