drivers:staging:ti-st: patches
cover drivers:staging:ti-st: patches
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality to protocol drivers. with the 3rd patch now providing context to even the protocol drivers, the single device limit or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit d39d49b393d94f4137cee4f64526a4695352f183
Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers context
drivers/staging/ti-st/bt_drv.c | 23 +++++--- drivers/staging/ti-st/st.h | 52 +++++++++-------- drivers/staging/ti-st/st_core.c | 118 +++++++++++++++++++-------------------- drivers/staging/ti-st/st_core.h | 74 +++++++++++++++++-------- drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)
PATCH 1/3 drivers:staging:ti-st: smarten, reduce logs
From: Pavan Savoy <[email protected]>
Replace looping on the data buffers and printk-ing by print_hex_dump.
Also replace most of the pr_info by pr_debug to reduce logging at default loglevels (7 in our case..)
--- drivers/staging/ti-st/st_core.c | 56 ++++++++++++++++---------------------- drivers/staging/ti-st/st_kim.c | 21 ++++++-------- drivers/staging/ti-st/st_ll.c | 4 +- 3 files changed, 35 insertions(+), 46 deletions(-)
drivers/staging/ti-st/st_core.c +24 -32
@@ -38,6 +38,7 @@#include "st_ll.h" #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
@@ -61,7 +62,7 @@ void (*st_recv) (void*, const unsigned char*, long);bool is_protocol_list_empty (void ) {unsigned char i =0 ; -pr_info (" %s " , __func__); +pr_debug (" %s " , __func__);for (i =0 ; i <ST_MAX ; i++) {if (st_gdata->list[i] !=NULL )return ST_NOTEMPTY ;
@@ -81,9 +82,6 @@ bool is_protocol_list_empty(void)int st_int_write (struct st_data_s *st_gdata,const unsigned char *data,int count) { -#ifdef VERBOSE /* for debug */ -int i; -#endif struct tty_struct *tty;if (unlikely (st_gdata ==NULL || st_gdata->tty ==NULL )) {pr_err ("tty unavailable to perform write" );
@@ -91,10 +89,8 @@ int st_int_write(struct st_data_s *st_gdata, } tty = st_gdata->tty;#ifdef VERBOSE -printk (KERN_ERR "start data..\n" ); -for (i =0 ; i < count; i++)/* no newlines for each datum */ -printk (" %x" , data[i]); -printk (KERN_ERR "\n ..end data\n" ); +print_hex_dump (KERN_DEBUG ,"<out<" ,DUMP_PREFIX_NONE , +16 ,1 , data, count,0 );#endif return tty->ops->write (tty, data, count);
@@ -132,7 +128,6 @@ void st_send_frame(enum proto_type protoid, struct st_data_s *st_gdata)pr_err (" proto stack %d's ->recv null" , protoid);kfree_skb (st_gdata->rx_skb); } -pr_info (" done %s" , __func__);return ; }
@@ -156,7 +151,7 @@ static inline int st_check_data_len(struct st_data_s *st_gdata, { registerint room =skb_tailroom (st_gdata->rx_skb); -pr_info ("len %d room %d" , len, room); +pr_debug ("len %d room %d" , len, room);if (!len) {/* Received packet has only packet header and
@@ -259,7 +254,7 @@ void st_int_recv(void *disc_data,/* Waiting for complete packet ? */ case ST_BT_W4_DATA : -pr_info ("Complete pkt received" ); +pr_debug ("Complete pkt received" );/* Ask ST CORE to forward * the packet to protocol driver */
@@ -275,7 +270,7 @@ void st_int_recv(void *disc_data, eh = (struct hci_event_hdr *)st_gdata->rx_skb-> data; -pr_info ("Event header: evt 0x%2.2x" +pr_debug ("Event header: evt 0x%2.2x" "plen %d" , eh->evt, eh->plen);st_check_data_len (st_gdata, protoid, eh->plen);
@@ -439,7 +434,7 @@ void st_int_recv(void *disc_data,break ; } } -pr_info ("done %s" , __func__); +pr_debug ("done %s" , __func__);return ; }
@@ -451,7 +446,7 @@ struct sk_buff *st_int_dequeue(struct st_data_s *st_gdata) {struct sk_buff *returning_skb; -pr_info ("%s" , __func__); +pr_debug ("%s" , __func__);/* if the previous skb wasn't written completely */ if (st_gdata->tx_skb !=NULL ) {
@@ -475,7 +470,7 @@ void st_int_enqueue(struct st_data_s *st_gdata, struct sk_buff *skb) {unsigned long flags =0 ; -pr_info ("%s" , __func__); +pr_debug ("%s" , __func__);/* this function can be invoked in more then one context. * so have a lock */ spin_lock_irqsave (&st_gdata->lock, flags);
@@ -508,7 +503,7 @@ void st_int_enqueue(struct st_data_s *st_gdata, struct sk_buff *skb)break ; }spin_unlock_irqrestore (&st_gdata->lock, flags); -pr_info ("done %s" , __func__); +pr_debug ("done %s" , __func__);return ; }
@@ -522,7 +517,7 @@ void st_tx_wakeup(struct st_data_s *st_data) {struct sk_buff *skb;unsigned long flags;/* for irq save flags */ -pr_info ("%s" , __func__); +pr_debug ("%s" , __func__);/* check for sending & set flag sending here */ if (test_and_set_bit (ST_TX_SENDING , &st_data->tx_state)) {pr_info ("ST already sending" );
@@ -674,7 +669,7 @@ long st_register(struct st_proto_s *new_proto)*/ if ((st_gdata->protos_registered !=ST_EMPTY ) && (test_bit (ST_REG_PENDING , &st_gdata->st_state))) { -pr_info (" call reg complete callback " ); +pr_debug (" call reg complete callback " );st_reg_complete (st_gdata,0 ); }clear_bit (ST_REG_PENDING , &st_gdata->st_state);
@@ -721,7 +716,7 @@ long st_register(struct st_proto_s *new_proto)spin_unlock_irqrestore (&st_gdata->lock, flags);return err; } -pr_info ("done %s(%d) " , __func__, new_proto->type); +pr_debug ("done %s(%d) " , __func__, new_proto->type); }EXPORT_SYMBOL_GPL (st_register);
@@ -734,7 +729,7 @@ long st_unregister(enum proto_type type)unsigned long flags =0 ;struct st_data_s *st_gdata; -pr_info ("%s: %d " , __func__, type); +pr_debug ("%s: %d " , __func__, type);st_kim_ref (&st_gdata);if (type <ST_BT || type >=ST_MAX ) {
@@ -816,7 +811,7 @@ long st_write(struct sk_buff *skb) return -1; }#endif -pr_info ("%d to be written" , skb->len); +pr_debug ("%d to be written" , skb->len); len = skb->len;/* st_ll to decide where to enqueue the skb */
@@ -859,7 +854,7 @@ static int st_tty_open(struct tty_struct *tty)* installation of N_TI_WL ldisc is complete */ st_kim_complete (st_gdata->kim_data); -pr_info ("done %s" , __func__); +pr_debug ("done %s" , __func__);return err; }
@@ -903,7 +898,7 @@ static void st_tty_close(struct tty_struct *tty) st_gdata->rx_skb =NULL ;spin_unlock_irqrestore (&st_gdata->lock, flags); -pr_info ("%s: done " , __func__); +pr_debug ("%s: done " , __func__); } static void st_tty_receive(struct tty_struct *tty, const unsigned char *data,
@@ -911,11 +906,8 @@ static void st_tty_receive(struct tty_struct *tty, const unsigned char *data, {#ifdef VERBOSE -long i; -printk (KERN_ERR "incoming data...\n" ); -for (i =0 ; i < count; i++) -printk (" %x" , data[i]); -printk (KERN_ERR "\n.. data end\n" ); +print_hex_dump (KERN_DEBUG ,">in>" ,DUMP_PREFIX_NONE , +16 ,1 , data, count,0 );#endif /*
@@ -923,7 +915,7 @@ static void st_tty_receive(struct tty_struct *tty, const unsigned char *data,* to KIM for validation */ st_recv (tty->disc_data, data, count); -pr_info ("done %s" , __func__); +pr_debug ("done %s" , __func__); }/* wake-up function called in from the TTY layer
@@ -932,7 +924,7 @@ static void st_tty_receive(struct tty_struct *tty, const unsigned char *data,static void st_tty_wakeup (struct tty_struct *tty) {struct st_data_s *st_gdata = tty->disc_data; -pr_info ("%s " , __func__); +pr_debug ("%s " , __func__);/* don't do an wakeup for now */ clear_bit (TTY_DO_WRITE_WAKEUP , &tty->flags);
@@ -943,7 +935,7 @@ static void st_tty_wakeup(struct tty_struct *tty)static void st_tty_flush_buffer (struct tty_struct *tty) {struct st_data_s *st_gdata = tty->disc_data; -pr_info ("%s " , __func__); +pr_debug ("%s " , __func__);kfree_skb (st_gdata->tx_skb); st_gdata->tx_skb =NULL ;
@@ -982,7 +974,7 @@ int st_core_init(struct st_data_s **core_data)kfree (st_ldisc_ops);return err; } -pr_info ("registered n_shared line discipline" ); +pr_debug ("registered n_shared line discipline" ); st_gdata =kzalloc (sizeof (struct st_data_s ),GFP_KERNEL );if (!st_gdata) {
drivers/staging/ti-st/st_kim.c +9 -12
@@ -129,7 +129,7 @@ static inline int kim_check_data_len(struct kim_data_s *kim_gdata, int len) { registerint room =skb_tailroom (kim_gdata->rx_skb); -pr_info ("len %d room %d" , len, room); +pr_debug ("len %d room %d" , len, room);if (!len) {validate_firmware_response (kim_gdata);
@@ -170,7 +170,7 @@ void kim_int_recv(struct kim_data_s *kim_gdata,struct hci_event_hdr *eh; registerint len =0 , type =0 ; -pr_info ("%s" , __func__); +pr_debug ("%s" , __func__);/* Decode received bytes here */ ptr = (char *)data;if (unlikely (ptr ==NULL )) {
@@ -192,7 +192,7 @@ void kim_int_recv(struct kim_data_s *kim_gdata,switch (kim_gdata->rx_state) {/* Waiting for complete packet ? */ case ST_BT_W4_DATA : -pr_info ("Complete pkt received" ); +pr_debug ("Complete pkt received" );validate_firmware_response (kim_gdata); kim_gdata->rx_state =ST_W4_PACKET_TYPE ; kim_gdata->rx_skb =NULL ;
@@ -201,7 +201,7 @@ void kim_int_recv(struct kim_data_s *kim_gdata,case ST_BT_W4_EVENT_HDR : eh = (struct hci_event_hdr *)kim_gdata-> rx_skb->data; -pr_info ("Event header: evt 0x%2.2x" +pr_debug ("Event header: evt 0x%2.2x" "plen %d" , eh->evt, eh->plen);kim_check_data_len (kim_gdata, eh->plen);continue ;
@@ -242,7 +242,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)unsigned short version =0 , chip =0 , min_ver =0 , maj_ver =0 ;char read_ver_cmd[] = {0x01 ,0x01 ,0x10 ,0x00 }; -pr_info ("%s" , __func__); +pr_debug ("%s" , __func__);INIT_COMPLETION (kim_gdata->kim_rcvd);if (4 !=st_int_write (kim_gdata->core_data, read_ver_cmd,4 )) {
@@ -289,8 +289,6 @@ static long download_firmware(struct kim_data_s *kim_gdata) registerunsigned char *action_ptr =NULL ;unsigned char bts_scr_name[30 ] = {0 };/* 30 char long bts scr name? */ -pr_info ("%s" , __func__); - err =read_local_version (kim_gdata, bts_scr_name);if (err !=0 ) {pr_err ("kim: failed to read local ver" );
@@ -314,7 +312,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) len -=sizeof (struct bts_header );while (len >0 && ptr) { -pr_info (" action size %d, type %d " , +pr_debug (" action size %d, type %d " , ((struct bts_action *)ptr)->size, ((struct bts_action *)ptr)->type);
@@ -327,8 +325,8 @@ static long download_firmware(struct kim_data_s *kim_gdata)/* ignore remote change * baud rate HCI VS command */ pr_err - (" change remote baud\ -rate command in firmware" ); + (" change remote baud" +" rate command in firmware" );break ; }
@@ -558,7 +556,6 @@ static ssize_t store_pid(struct device *dev, struct device_attribute *devattr, char *buf, size_t count) {struct kim_data_s *kim_gdata =dev_get_drvdata (dev); -pr_info ("%s: pid %s " , __func__, buf);sscanf (buf,"%ld" , &kim_gdata->uim_pid);/* to be made use by kim_start to signal SIGUSR2 */
@@ -590,7 +587,7 @@ static ssize_t show_list(struct device *dev, struct device_attributestatic int kim_toggle_radio (void *data,bool blocked) {enum proto_type type = *((enum proto_type *)data); -pr_info (" %s: %d " , __func__, type); +pr_debug (" %s: %d " , __func__, type);switch (type) {case ST_BT :
drivers/staging/ti-st/st_ll.c +2 -2
@@ -34,7 +34,7 @@ static void send_ll_cmd(struct st_data_s *st_data,static void ll_device_want_to_sleep (struct st_data_s *st_data) { -pr_info ("%s" , __func__); +pr_debug ("%s" , __func__);/* sanity check */ if (st_data->ll_state !=ST_LL_AWAKE ) pr_err("ERR hcill: ST_LL_GO_TO_SLEEP_IND"
@@ -101,7 +101,7 @@ void st_ll_wakeup(struct st_data_s *ll)/* called when ST Core wants the state */ unsigned long st_ll_getstate (struct st_data_s *ll) { -pr_info (" returning state %ld" , ll->ll_state); +pr_debug (" returning state %ld" , ll->ll_state);return ll->ll_state; }
Signature · 1 line
1.5.6.3
PATCH 2/3 drivers:staging:ti-st: cleanup code comments
From: Pavan Savoy <[email protected]>
cleanup the code commenting in the headers/structures, also cleanup few inline commenting in the function
--- drivers/staging/ti-st/st.h | 44 +++++++++++------------ drivers/staging/ti-st/st_core.c | 54 ++++++++++++++------------- drivers/staging/ti-st/st_core.h | 74 ++++++++++++++++++++++++++------------ drivers/staging/ti-st/st_kim.c | 52 ++++++++++++++++++--------- drivers/staging/ti-st/st_kim.h | 77 +++++++++++++++++++++++++-------------- drivers/staging/ti-st/st_ll.h | 9 ++++- 6 files changed, 193 insertions(+), 117 deletions(-)
drivers/staging/ti-st/st.h +21 -23
@@ -24,24 +24,24 @@#define ST_H #include <linux/skbuff.h> -/* -* st.h -*/ /* TODO: * Move the following to tty.h upon acceptance */ #define N_TI_WL 20/* Ldisc for TI's WL BT, FM, GPS combo chips */ -/* some gpios have active high, others like fm have -* active low +/** +* enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW +* gpio states for their chip/core enable gpios */ enum kim_gpio_state {KIM_GPIO_INACTIVE ,KIM_GPIO_ACTIVE , }; -/* -* the list of protocols on chip + +/** +* enum proto-type - The protocol on WiLink chips which share a +* common physical interface like UART. */ enum proto_type {ST_BT ,
@@ -50,28 +50,26 @@ enum proto_type { ST_MAX, }; -/* per protocol structure -* for BT/FM and GPS +/** +* struct st_proto_s - Per Protocol structure from BT/FM/GPS to ST +* @type: type of the protocol being registered among the +* available proto_type(BT, FM, GPS the protocol which share TTY). +* @recv: the receiver callback pointing to a function in the +* protocol drivers called by the ST driver upon receiving +* relevant data. +* @match_packet: reserved for future use, to make ST more generic +* @reg_complete_cb: callback handler pointing to a function in protocol +* handler called by ST when the pending registrations are complete. +* The registrations are marked pending, in situations when fw +* download is in progress. +* @write: pointer to function in ST provided to protocol drivers from ST, +* to be made use when protocol drivers have data to send to TTY. */ struct st_proto_s {enum proto_type type; -/* -* to be called by ST when data arrives -*/ long (*recv) (struct sk_buff *); -/* -* for future use, logic now to be in ST -*/ unsigned char (*match_packet) (const unsigned char *data); -/* -* subsequent registration return PENDING, -* signalled complete by this callback function -*/ void (*reg_complete_cb) (char data); -/* -* write function, sent in as NULL and to be returned to -* protocol drivers -*/ long (*write) (struct sk_buff *skb); };
drivers/staging/ti-st/st_core.c +28 -26
121 lines not on this page · raw message
drivers/staging/ti-st/st_core.h +51 -23
110 lines not on this page · raw message
drivers/staging/ti-st/st_kim.c +35 -17
101 lines not on this page · raw message
drivers/staging/ti-st/st_kim.h +50 -27
127 lines not on this page · raw message
drivers/staging/ti-st/st_ll.h +8 -1
@@ -41,6 +41,7 @@#define ST_LL_AWAKE_TO_ASLEEP 3#define ST_LL_INVALID 4 +/* different PM notifications coming from chip */ #define LL_SLEEP_IND 0x30#define LL_SLEEP_ACK 0x31#define LL_WAKE_UP_IND 0x32
@@ -50,13 +51,19 @@long st_ll_init (struct st_data_s *);long st_ll_deinit (struct st_data_s *); -/* enable/disable ST LL along with KIM start/stop +/** +* enable/disable ST LL along with KIM start/stop * called by ST Core */ void st_ll_enable (struct st_data_s *);void st_ll_disable (struct st_data_s *); +/** +* various funcs used by ST core to set/get the various PM states +* of the chip. +*/ unsigned long st_ll_getstate (struct st_data_s *);unsigned long st_ll_sleep_state (struct st_data_s *,unsigned char );void st_ll_wakeup (struct st_data_s *); +#endif /* ST_LL_H */
Signature · 1 line
1.5.6.3
PATCH 3/3 drivers:staging:ti-st: give proto drivers context
From: Pavan Savoy <[email protected]>
protocol drivers such as BT, FM and GPS when registering to ST now provide their own private data which they expect when their functions namely registration completed & receive are called.
Also upon tty_close, set protos_registered count to 0, although all protocols are marked un-registered.
--- drivers/staging/ti-st/bt_drv.c | 23 +++++++++++++++-------- drivers/staging/ti-st/st.h | 8 ++++++-- drivers/staging/ti-st/st_core.c | 8 ++++++-- 3 files changed, 27 insertions(+), 12 deletions(-)
drivers/staging/ti-st/bt_drv.c +15 -8
@@ -80,31 +80,33 @@ static inline void hci_st_tx_complete(struct hci_st *hst, int pkt_type)* status.hci_st_open() function will wait for signal from this * API when st_register() function returns ST_PENDING. */ -static void hci_st_registration_completion_cb (char data) +static void hci_st_registration_completion_cb (void *priv_data,char data) { +struct hci_st *lhst = (struct hci_st *)priv_data;BTDRV_API_START ();/* hci_st_open() function needs value of 'data' to know * the registration status(success/fail),So have a back * up of it. */ - hst->streg_cbdata = data; + lhst->streg_cbdata = data;/* Got a feedback from ST for BT driver registration * request.Wackup hci_st_open() function to continue * it's open operation. */ -complete (&hst->wait_for_btdrv_reg_completion); +complete (&lhst->wait_for_btdrv_reg_completion);BTDRV_API_EXIT (0 ); }/* Called by Shared Transport layer when receive data is * available */ -static long hci_st_receive (struct sk_buff *skb) +static long hci_st_receive (void *priv_data,struct sk_buff *skb) {int err;int len; +struct hci_st *lhst = (struct hci_st *)priv_data;BTDRV_API_START ();
@@ -116,13 +118,13 @@ static long hci_st_receive(struct sk_buff *skb)BTDRV_API_EXIT (-EFAULT );return -EFAULT ; } -if (!hst) { +if (!lhst) {kfree_skb (skb);BT_DRV_ERR ("Invalid hci_st memory,freeing SKB" );BTDRV_API_EXIT (-EFAULT );return -EFAULT ; } -if (!test_bit (BT_DRV_RUNNING , &hst->flags)) { +if (!test_bit (BT_DRV_RUNNING , &lhst->flags)) {kfree_skb (skb);BT_DRV_ERR ("Device is not running,freeing SKB" );BTDRV_API_EXIT (-EINVAL );
@@ -130,7 +132,7 @@ static long hci_st_receive(struct sk_buff *skb) } len = skb->len; - skb->dev = (struct net_device *)hst->hdev; + skb->dev = (struct net_device *)lhst->hdev;/* Forward skb to HCI CORE layer */ err =hci_recv_frame (skb);
@@ -141,7 +143,7 @@ static long hci_st_receive(struct sk_buff *skb)BTDRV_API_EXIT (err);return err; } - hst->hdev->stat.byte_rx += len; + lhst->hdev->stat.byte_rx += len;BTDRV_API_EXIT (0 );return 0 ;
@@ -189,6 +191,11 @@ static int hci_st_open(struct hci_dev *hdev)* make it as NULL */ hci_st_proto.write =NULL ; +/* send in the hst to be received at registration complete callback +* and during st's receive +*/ + hci_st_proto.priv_data = hst; +/* Register with ST layer */ err =st_register (&hci_st_proto);if (err == -EINPROGRESS ) {
drivers/staging/ti-st/st.h +6 -2
@@ -64,13 +64,17 @@ enum proto_type {* download is in progress. * @write: pointer to function in ST provided to protocol drivers from ST, * to be made use when protocol drivers have data to send to TTY. +* @priv_data: privdate data holder for the protocol drivers, sent +* from the protocol drivers during registration, and sent back on +* reg_complete_cb and recv. */ struct st_proto_s {enum proto_type type; -long (*recv) (struct sk_buff *); +long (*recv) (void *,struct sk_buff *);unsigned char (*match_packet) (const unsigned char *data); -void (*reg_complete_cb) (char data); +void (*reg_complete_cb) (void *,char data);long (*write) (struct sk_buff *skb); +void *priv_data; };extern long st_register (struct st_proto_s *);
drivers/staging/ti-st/st_core.c +6 -2
@@ -119,7 +119,9 @@ void st_send_frame(enum proto_type protoid, struct st_data_s *st_gdata)* protocol stack driver */ if (likely (st_gdata->list[protoid]->recv !=NULL )) { -if (unlikely (st_gdata->list[protoid]->recv (st_gdata->rx_skb) +if (unlikely + (st_gdata->list[protoid]->recv + (st_gdata->list[protoid]->priv_data, st_gdata->rx_skb) !=0 )) {pr_err (" proto stack %d's ->recv failed" , protoid);kfree_skb (st_gdata->rx_skb);
@@ -144,7 +146,8 @@ void st_reg_complete(struct st_data_s *st_gdata, char err)for (i =0 ; i <ST_MAX ; i++) {if (likely (st_gdata !=NULL && st_gdata->list[i] !=NULL && st_gdata->list[i]->reg_complete_cb !=NULL )) - st_gdata->list[i]->reg_complete_cb (err); + st_gdata->list[i]->reg_complete_cb + (st_gdata->list[i]->priv_data, err); } }
@@ -878,6 +881,7 @@ static void st_tty_close(struct tty_struct *tty)pr_err ("%d not un-registered" , i); st_gdata->list[i] =NULL ; } + st_gdata->protos_registered =0 ;spin_unlock_irqrestore (&st_gdata->lock, flags);/* * signal to UIM via KIM that -
Signature · 1 line
1.5.6.3
Quoted 15 lines · On Thu, 22 Jul 2010 05:32:04 -0500 [email protected] wrote:
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality to protocol drivers. with the 3rd patch now providing context to even the protocol drivers, the single device limit or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit
d39d49b393d94f4137cee4f64526a4695352f183Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers context
Quoted 9 lines
drivers/staging/ti-st/bt_drv.c | 23 +++++--- drivers/staging/ti-st/st.h | 52 +++++++++-------- drivers/staging/ti-st/st_core.c | 118 +++++++++++++++++++-------------------- drivers/staging/ti-st/st_core.h | 74 +++++++++++++++++-------- drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)
Hi,
I have reported this error a few times. Where is the patch for it??
ERROR: "st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!
thanks,
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Randy,
Quoted 27 lines · Randy Dunlap
Quoted 19 lines · On Thu, 22 Jul 2010 05:32:04 -0500 [email protected] wrote:
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality to protocol drivers. with the 3rd patch now providing context to even the protocol drivers, the single device limit or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit
d39d49b393d94f4137cee4f64526a4695352f183Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers contextdrivers/staging/ti-st/bt_drv.c | 23 +++++---
drivers/staging/ti-st/st.h| 52 +++++++++--------drivers/staging/ti-st/st_core.c| 118 +++++++++++++++++++--------------------drivers/staging/ti-st/st_core.h| 74 +++++++++++++++++--------Quoted 5 lines
drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)
Quoted 5 lines
Hi,
I have reported this error a few times. Where is the patch for it??
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!
Yes, on one of the earlier patch sets, I had mentioned that the ST driver being a platform device, needs definition in any of the arch/XX/mach-XX/board-XX.c or devices.c or somewhere...
and hence it is in that board-XX.c file that the symbol st_get_plat_device needs to be exported, the reason for that being,
ST driver being both a TTY ldisc driver and platform driver, in TTY contexts it would need to refer to platform driver's data. So it does a st_get_plat_device which returns the platform device structure, and then does a dev_getdrvdata from it.
here's a snippet of code ...
/*
* ST related functions related functions
*/
#include <linux/platform_device.h>
long gpios[] = { 55, -1, -1 };
static struct platform_device ti_st_device = {
.name = "kim",
.id = -1,
.dev.platform_data = &gpios,
};
struct platform_device *st_get_plat_device(void)
{
return &ti_st_device;
}EXPORT_SYMBOL(st_get_plat_device);
static __init int add_ti_st_device(void)
{
platform_device_register(&ti_st_device);
dev_info(&ti_st_device.dev,"registered platform TI ST device\n");
return 0;
}device_initcall(add_ti_st_device);
We have that in our local trees in arch/arm/mach-omap2/board-sdp4430.c
Quoted 6 lines
thanks,
---
~Randy
*** Remember to useDocumentation/SubmitChecklistwhen testing your code ***
Quoted 75 lines · Pavan Savoy
Randy,
Quoted 27 lines · Randy Dunlap
Quoted 15 lines · On Thu, 22 Jul 2010 05:32:04 -0500 [email protected] wrote:
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality to protocol drivers. with the 3rd patch now providing context to even the protocol drivers, the single device limit or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit
d39d49b393d94f4137cee4f64526a4695352f183Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers contextQuoted 9 lines
drivers/staging/ti-st/bt_drv.c | 23 +++++--- drivers/staging/ti-st/st.h | 52 +++++++++-------- drivers/staging/ti-st/st_core.c | 118 +++++++++++++++++++-------------------- drivers/staging/ti-st/st_core.h | 74 +++++++++++++++++-------- drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)Quoted 5 lines
Hi,
I have reported this error a few times. Where is the patch for it??
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!Yes, on one of the earlier patch sets, I had mentioned that the ST driver being a platform device, needs definition in any of the
arch/XX/mach-XX/board-XX.cordevices.cor somewhere...and hence it is in that
board-XX.cfile that the symbolst_get_plat_deviceneeds to be exported, the reason for that being,ST driver being both a TTY ldisc driver and platform driver, in TTY contexts it would need to refer to platform driver's data. So it does a
st_get_plat_devicewhich returns the platform device structure, and then does adev_getdrvdatafrom it.here's a snippet of code ...
/*
* ST related functions related functions
*/
#include <linux/platform_device.h>long gpios[] = { 55, -1, -1 };
static structplatform_deviceti_st_device= {
.name = "kim",
.id = -1,
.dev.platform_data = &gpios,
};struct
platform_device*st_get_plat_device(void){ return &ti_st_device; }
EXPORT_SYMBOL(st_get_plat_device);static
__initintadd_ti_st_device(void){ platform_device_register(&ti_st_device); dev_info(&ti_st_device.dev,"registered platform TI ST device\n"); return 0; }
Quoted 4 lines
device_initcall(add_ti_st_device);We have that in our local trees in
arch/arm/mach-omap2/board-sdp4430.c
Thanks for the explanation.
Is the driver platform-specific?
E.g., should it not even be built on x86?
Signature · 2 lines
~Randy *** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 79 lines · Randy Dunlap
Quoted 78 lines · Pavan Savoy
Randy,
Quoted 27 lines · Randy Dunlap
Quoted 19 lines · On Thu, 22 Jul 2010 05:32:04 -0500 [email protected] wrote:
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality to protocol drivers. with the 3rd patch now providing context to even the protocol drivers, the single device limit or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit
d39d49b393d94f4137cee4f64526a4695352f183Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers contextdrivers/staging/ti-st/bt_drv.c | 23 +++++---
drivers/staging/ti-st/st.h| 52 +++++++++--------drivers/staging/ti-st/st_core.c| 118 +++++++++++++++++++--------------------drivers/staging/ti-st/st_core.h| 74 +++++++++++++++++--------Quoted 5 lines
drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)Quoted 5 lines
Hi,
I have reported this error a few times. Where is the patch for it??
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!Yes, on one of the earlier patch sets, I had mentioned that the ST driver being a platform device, needs definition in any of the
arch/XX/mach-XX/board-XX.cordevices.cor somewhere...and hence it is in that
board-XX.cfile that the symbolst_get_plat_deviceneeds to be exported, the reason for that being,ST driver being both a TTY ldisc driver and platform driver, in TTY contexts it would need to refer to platform driver's data. So it does a
st_get_plat_devicewhich returns the platform device structure, and then does adev_getdrvdatafrom it.here's a snippet of code ...
/*
* ST related functions related functions
*/
#include <linux/platform_device.h>long gpios[] = { 55, -1, -1 };
static structplatform_deviceti_st_device= {
.name = "kim",
.id = -1,
.dev.platform_data = &gpios,
};struct
platform_device*st_get_plat_device(void)
{
return&ti_st_device;
}EXPORT_SYMBOL(st_get_plat_device);static
__initintadd_ti_st_device(void)
{
platform_device_register(&ti_st_device);dev_info(&ti_st_device.dev,"registered platform TI ST device\n");return 0;
}device_initcall(add_ti_st_device);
Quoted 6 lines
Quoted 1 line
We have that in our local trees in
arch/arm/mach-omap2/board-sdp4430.cThanks for the explanation.
Is the driver platform-specific?
E.g., should it not even be built on x86?
Yes. Requirement of the hardware is very much a must. However it is a separate peripheral (WiLink 7 - uart interfaced), may be there is a x86 platform with this - but certainly not desktops.
on linux-next, I generally put in that st_dev.c file for x86 - verify whether it builds as a module, inserts/rmmod, basic other functionalities (which doesn't involve response from chip..) But verify full functionality on board which constitutes that.
Quoted 4 lines
--
~Randy
*** Remember to useDocumentation/SubmitChecklistwhen testing your code ***
Quoted 87 lines · On Mon, 26 Jul 2010 10:37:02 +0530 Pavan Savoy wrote:
Quoted 79 lines · Randy Dunlap
Quoted 78 lines · Pavan Savoy
Randy,
Quoted 27 lines · Randy Dunlap
Quoted 19 lines · On Thu, 22 Jul 2010 05:32:04 -0500 [email protected] wrote:
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality to protocol drivers. with the 3rd patch now providing context to even the protocol drivers, the single device limit or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit
d39d49b393d94f4137cee4f64526a4695352f183Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers contextdrivers/staging/ti-st/bt_drv.c | 23 +++++---
drivers/staging/ti-st/st.h| 52 +++++++++--------drivers/staging/ti-st/st_core.c| 118 +++++++++++++++++++--------------------drivers/staging/ti-st/st_core.h| 74 +++++++++++++++++--------Quoted 5 lines
drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)Quoted 5 lines
Hi,
I have reported this error a few times. Where is the patch for it??
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!Yes, on one of the earlier patch sets, I had mentioned that the ST driver being a platform device, needs definition in any of the
arch/XX/mach-XX/board-XX.cordevices.cor somewhere...and hence it is in that
board-XX.cfile that the symbolst_get_plat_deviceneeds to be exported, the reason for that being,ST driver being both a TTY ldisc driver and platform driver, in TTY contexts it would need to refer to platform driver's data. So it does a
st_get_plat_devicewhich returns the platform device structure, and then does adev_getdrvdatafrom it.here's a snippet of code ...
/*
* ST related functions related functions
*/
#include <linux/platform_device.h>long gpios[] = { 55, -1, -1 };
static structplatform_deviceti_st_device= {
.name = "kim",
.id = -1,
.dev.platform_data = &gpios,
};struct
platform_device*st_get_plat_device(void)
{
return&ti_st_device;
}EXPORT_SYMBOL(st_get_plat_device);static
__initintadd_ti_st_device(void)
{
platform_device_register(&ti_st_device);dev_info(&ti_st_device.dev,"registered platform TI ST device\n");return 0;
}device_initcall(add_ti_st_device);Quoted 6 lines
Quoted 1 line
We have that in our local trees in
arch/arm/mach-omap2/board-sdp4430.cThanks for the explanation.
Is the driver platform-specific?
E.g., should it not even be built on x86?
Quoted 8 lines
Yes. Requirement of the hardware is very much a must. However it is a separate peripheral (WiLink 7 - uart interfaced), may be there is a x86 platform with this - but certainly not desktops.
on linux-next, I generally put in that
st_dev.cfile for x86 - verify whether it builds as a module, inserts/rmmod, basic other functionalities (which doesn't involve response from chip..) But verify full functionality on board which constitutes that.
Hi,
Please make this driver build cleanly on X86 or prevent it from being built there.
thanks,
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Randy,
Quoted 106 lines
-----Original Message-----
From: Randy Dunlap [mailto:[email protected]]
Sent: Wednesday, August 18, 2010 4:05 PM
To: Savoy, Pavan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 0/3] drivers:staging:ti-st: patchesQuoted 1 line · On Mon, 26 Jul 2010 10:37:02 +0530 Pavan Savoy wrote:
On Fri, Jul 23, 2010 at 8:47 PM, Randy Dunlap <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines · Pavan Savoy
Quoted 3 lines
Randy,
On Fri, Jul 23, 2010 at 1:23 AM, Randy Dunlap <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · On Thu, 22 Jul 2010 05:32:04 -0500 [email protected] wrote:
Quoted 4 lines
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality
to protocol drivers.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
with the 3rd patch now providing context to even the protocol drivers,
the single device limit
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit
d39d49b393d94f4137cee4f64526a4695352f183Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers contextdrivers/staging/ti-st/bt_drv.c | 23 +++++---
drivers/staging/ti-st/st.h| 52 +++++++++--------drivers/staging/ti-st/st_core.c| 118 +++++++++++++++++++--------------------
Quoted 66 lines
Quoted 55 lines
Quoted 55 lines
Quoted 7 lines
Quoted 6 lines
drivers/staging/ti-st/st_core.h | 74 +++++++++++++++++--------
drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)Quoted 5 lines
Hi,
I have reported this error a few times. Where is the patch for it??
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!Yes, on one of the earlier patch sets, I had mentioned that the ST driver being a platform device, needs definition in any of the
arch/XX/mach-XX/board-XX.cordevices.cor somewhere...and hence it is in that
board-XX.cfile that the symbolst_get_plat_deviceneeds to be exported, the reason for that being,ST driver being both a TTY ldisc driver and platform driver, in TTY contexts it would need to refer to platform driver's data. So it does a
st_get_plat_devicewhich returns the platform device structure, and then does adev_getdrvdatafrom it.here's a snippet of code ...
/*
* ST related functions related functions
*/
#include <linux/platform_device.h>long gpios[] = { 55, -1, -1 };
static structplatform_deviceti_st_device= {
.name = "kim",
.id = -1,
.dev.platform_data = &gpios,
};struct
platform_device*st_get_plat_device(void)
{
return&ti_st_device;
}EXPORT_SYMBOL(st_get_plat_device);static
__initintadd_ti_st_device(void)
{
platform_device_register(&ti_st_device);dev_info(&ti_st_device.dev,"registered platform TI ST device\n");return 0;
}device_initcall(add_ti_st_device);Quoted 6 lines
Quoted 1 line
We have that in our local trees in
arch/arm/mach-omap2/board-sdp4430.cThanks for the explanation.
Is the driver platform-specific?
E.g., should it not even be built on x86?Yes. Requirement of the hardware is very much a must. However it is a separate peripheral (WiLink 7 - uart interfaced), may be there is a x86 platform with this - but certainly not desktops.
Quoted 8 lines
Quoted 4 lines
on linux-next, I generally put in that
st_dev.cfile for x86 - verify whether it builds as a module, inserts/rmmod, basic other functionalities (which doesn't involve response from chip..) But verify full functionality on board which constitutes that.Hi,
Please make this driver build cleanly on X86 or prevent it from being built there.
Do you do something like a make allyesconfig?
I am having a hard time figuring out why is it building for you in the first place? make defconfig doesn't build it, neither does make i386_defconfig.
May be a patch which does 'default N' in drivers/staging/ti-st/Kconfig, would suffice? Please suggest...
Quoted 4 lines
thanks,
---
~Randy
*** Remember to useDocumentation/SubmitChecklistwhen testing your code ***
Quoted 114 lines · Pavan
Randy,
Quoted 111 lines
-----Original Message-----
From: Randy Dunlap [mailto:[email protected]]
Sent: Wednesday, August 18, 2010 4:05 PM
To: Savoy, Pavan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 0/3] drivers:staging:ti-st: patchesQuoted 1 line · On Mon, 26 Jul 2010 10:37:02 +0530 Pavan Savoy wrote:
On Fri, Jul 23, 2010 at 8:47 PM, Randy Dunlap <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines · Pavan Savoy
Quoted 3 lines
Randy,
On Fri, Jul 23, 2010 at 1:23 AM, Randy Dunlap <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · On Thu, 22 Jul 2010 05:32:04 -0500 [email protected] wrote:
Quoted 4 lines
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality
to protocol drivers.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
with the 3rd patch now providing context to even the protocol drivers,
the single device limit
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit
d39d49b393d94f4137cee4f64526a4695352f183Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers contextdrivers/staging/ti-st/bt_drv.c | 23 +++++--- drivers/staging/ti-st/st.h | 52 +++++++++-------- drivers/staging/ti-st/st_core.c | 118 +++++++++++++++++++--------------------
Quoted 70 lines
Quoted 55 lines
Quoted 55 lines
Quoted 7 lines
Quoted 6 lines
drivers/staging/ti-st/st_core.h | 74 +++++++++++++++++-------- drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)Quoted 5 lines
Hi,
I have reported this error a few times. Where is the patch for it??
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!Yes, on one of the earlier patch sets, I had mentioned that the ST driver being a platform device, needs definition in any of the
arch/XX/mach-XX/board-XX.cordevices.cor somewhere...and hence it is in that
board-XX.cfile that the symbolst_get_plat_deviceneeds to be exported, the reason for that being,ST driver being both a TTY ldisc driver and platform driver, in TTY contexts it would need to refer to platform driver's data. So it does a
st_get_plat_devicewhich returns the platform device structure, and then does adev_getdrvdatafrom it.here's a snippet of code ...
/*
* ST related functions related functions
*/
#include <linux/platform_device.h>long gpios[] = { 55, -1, -1 };
static structplatform_deviceti_st_device= {
.name = "kim",
.id = -1,
.dev.platform_data = &gpios,
};struct
platform_device*st_get_plat_device(void){ return &ti_st_device; }
EXPORT_SYMBOL(st_get_plat_device);static
__initintadd_ti_st_device(void){ platform_device_register(&ti_st_device); dev_info(&ti_st_device.dev,"registered platform TI ST device\n"); return 0; }
device_initcall(add_ti_st_device);Quoted 6 lines
Quoted 1 line
We have that in our local trees in
arch/arm/mach-omap2/board-sdp4430.cThanks for the explanation.
Is the driver platform-specific?
E.g., should it not even be built on x86?Yes. Requirement of the hardware is very much a must. However it is a separate peripheral (WiLink 7 - uart interfaced), may be there is a x86 platform with this - but certainly not desktops.
on linux-next, I generally put in that
st_dev.cfile for x86 - verify whether it builds as a module, inserts/rmmod, basic other functionalities (which doesn't involve response from chip..) But verify full functionality on board which constitutes that.
Quoted 5 lines
Quoted 3 lines
Hi,
Please make this driver build cleanly on X86 or prevent it from being built there.Do you do something like a make allyesconfig?
I do 50 X86 randconfig builds per night (scripted, while I sleep). As long as STAGING is enabled and RFKILL is enabled, then TI_ST can be enabled, so usually it fails to build.
Quoted 2 lines
I am having a hard time figuring out why is it building for you in the first place? make defconfig doesn't build it, neither does make
i386_defconfig.
That is irrelevant. It's now in mainline and it is causing build failures.
Quoted 1 line
May be a patch which does 'default N' in
drivers/staging/ti-st/Kconfig, would suffice?
Nope.
Quoted 3 lines
Please suggest...
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!
st_get_plat_device will have to be defined for any build platform, or not referenced, or make it not possible to enable TI_ST unless st_get_plat_device is defined.
Signature · 2 lines
~Randy *** Remember to use Documentation/SubmitChecklist when testing your code ***
Randy,
Quoted 134 lines · Randy Dunlap
Quoted 114 lines · Pavan
Randy,
Quoted 111 lines
-----Original Message-----
From: Randy Dunlap [mailto:[email protected]]
Sent: Wednesday, August 18, 2010 4:05 PM
To: Savoy, Pavan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 0/3] drivers:staging:ti-st: patchesQuoted 1 line · On Mon, 26 Jul 2010 10:37:02 +0530 Pavan Savoy wrote:
On Fri, Jul 23, 2010 at 8:47 PM, Randy Dunlap <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines · Pavan Savoy
Quoted 3 lines
Randy,
On Fri, Jul 23, 2010 at 1:23 AM, Randy Dunlap <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · On Thu, 22 Jul 2010 05:32:04 -0500 [email protected] wrote:
Quoted 4 lines
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality
to protocol drivers.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
with the 3rd patch now providing context to even the protocol drivers,
the single device limit
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit
d39d49b393d94f4137cee4f64526a4695352f183Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers contextdrivers/staging/ti-st/bt_drv.c | 23 +++++---
drivers/staging/ti-st/st.h| 52 +++++++++--------drivers/staging/ti-st/st_core.c| 118 +++++++++++++++++++--------------------
Quoted 70 lines
Quoted 55 lines
Quoted 55 lines
Quoted 7 lines
Quoted 6 lines
drivers/staging/ti-st/st_core.h | 74 +++++++++++++++++--------
drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)Quoted 5 lines
Hi,
I have reported this error a few times. Where is the patch for it??
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!Yes, on one of the earlier patch sets, I had mentioned that the ST driver being a platform device, needs definition in any of the
arch/XX/mach-XX/board-XX.cordevices.cor somewhere...and hence it is in that
board-XX.cfile that the symbolst_get_plat_deviceneeds to be exported, the reason for that being,ST driver being both a TTY ldisc driver and platform driver, in TTY contexts it would need to refer to platform driver's data. So it does a
st_get_plat_devicewhich returns the platform device structure, and then does adev_getdrvdatafrom it.here's a snippet of code ...
/*
* ST related functions related functions
*/
#include <linux/platform_device.h>long gpios[] = { 55, -1, -1 };
static structplatform_deviceti_st_device= {
.name = "kim",
.id = -1,
.dev.platform_data = &gpios,
};struct
platform_device*st_get_plat_device(void)
{
return&ti_st_device;
}EXPORT_SYMBOL(st_get_plat_device);static
__initintadd_ti_st_device(void)
{
platform_device_register(&ti_st_device);dev_info(&ti_st_device.dev,"registered platform TI ST device\n");return 0;
}device_initcall(add_ti_st_device);Quoted 6 lines
Quoted 1 line
We have that in our local trees in
arch/arm/mach-omap2/board-sdp4430.cThanks for the explanation.
Is the driver platform-specific?
E.g., should it not even be built on x86?Yes. Requirement of the hardware is very much a must. However it is a separate peripheral (WiLink 7 - uart interfaced), may be there is a x86 platform with this - but certainly not desktops.
on linux-next, I generally put in that
st_dev.cfile for x86 - verify whether it builds as a module, inserts/rmmod, basic other functionalities (which doesn't involve response from chip..) But verify full functionality on board which constitutes that.Quoted 5 lines
Quoted 3 lines
Hi,
Please make this driver build cleanly on X86 or prevent it from being built there.Do you do something like a make allyesconfig?
I do 50 X86 randconfig builds per night (scripted, while I sleep). As long as STAGING is enabled and RFKILL is enabled, then
TI_STcan be enabled, so usually it fails to build.Quoted 2 lines
I am having a hard time figuring out why is it building for you in the first place? make defconfig doesn't build it, neither does make
i386_defconfig.That is irrelevant. It's now in mainline and it is causing build failures.
Quoted 1 line
May be a patch which does 'default N' in
drivers/staging/ti-st/Kconfig, would suffice?Nope.
Quoted 7 lines
Quoted 3 lines
Please suggest...
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!
st_get_plat_devicewill have to be defined for any build platform, or not referenced, or make it not possible to enableTI_STunlessst_get_plat_deviceis defined.
I was thinking as to why do I even have this platform device reference via an exported symbol,
and thanks for pointing out, I don't even need this function "st_get_plat_device()".
I already have the platform_device reference in my _probe function !!!.. I will send out a patch 2morrow.
This actually sorts of clarifies how I support multiple devices too... This is how my probe would then look like ...
static int kim_probe(struct platform_device *pdev)
{
....
...
platform_devices_i_have[id] = pdev;
.....
....
}
and st_get_plat_device(int id) would be defined as... {
return platform_devices_i_have[id];
}
Does this sound ok ?
Quoted 11 lines
--
~Randy
*** Remember to useDocumentation/SubmitChecklistwhen testing your code *** --
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 145 lines · Pavan Savoy
Randy,
Quoted 134 lines · Randy Dunlap
Quoted 114 lines · Pavan
Randy,
Quoted 111 lines
-----Original Message-----
From: Randy Dunlap [mailto:[email protected]]
Sent: Wednesday, August 18, 2010 4:05 PM
To: Savoy, Pavan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 0/3] drivers:staging:ti-st: patchesQuoted 1 line · On Mon, 26 Jul 2010 10:37:02 +0530 Pavan Savoy wrote:
On Fri, Jul 23, 2010 at 8:47 PM, Randy Dunlap <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines · Pavan Savoy
Quoted 3 lines
Randy,
On Fri, Jul 23, 2010 at 1:23 AM, Randy Dunlap <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · On Thu, 22 Jul 2010 05:32:04 -0500 [email protected] wrote:
Quoted 4 lines
From: Pavan Savoy <[email protected]>
The following patches cleanup bit of a mess and also adds functionality
to protocol drivers.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
with the 3rd patch now providing context to even the protocol drivers,
the single device limit
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
or support for multiple devices would be easier to implement.
These patches depend on the previously submitted 0001-drivers-staging-ti-st-make-use-of-linux-err-codes.patch commit
d39d49b393d94f4137cee4f64526a4695352f183Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Pavan Savoy (3):
drivers:staging:ti-st: smarten, reduce logs drivers:staging:ti-st: cleanup code comments drivers:staging:ti-st: give proto drivers contextdrivers/staging/ti-st/bt_drv.c | 23 +++++--- drivers/staging/ti-st/st.h | 52 +++++++++-------- drivers/staging/ti-st/st_core.c | 118 +++++++++++++++++++--------------------
Quoted 70 lines
Quoted 55 lines
Quoted 55 lines
Quoted 7 lines
Quoted 6 lines
drivers/staging/ti-st/st_core.h | 74 +++++++++++++++++-------- drivers/staging/ti-st/st_kim.c | 73 ++++++++++++++---------- drivers/staging/ti-st/st_kim.h | 77 ++++++++++++++++--------- drivers/staging/ti-st/st_ll.c | 4 +- drivers/staging/ti-st/st_ll.h | 9 +++- 8 files changed, 255 insertions(+), 175 deletions(-)Quoted 5 lines
Hi,
I have reported this error a few times. Where is the patch for it??
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!Yes, on one of the earlier patch sets, I had mentioned that the ST driver being a platform device, needs definition in any of the
arch/XX/mach-XX/board-XX.cordevices.cor somewhere...and hence it is in that
board-XX.cfile that the symbolst_get_plat_deviceneeds to be exported, the reason for that being,ST driver being both a TTY ldisc driver and platform driver, in TTY contexts it would need to refer to platform driver's data. So it does a
st_get_plat_devicewhich returns the platform device structure, and then does adev_getdrvdatafrom it.here's a snippet of code ...
/*
* ST related functions related functions
*/
#include <linux/platform_device.h>long gpios[] = { 55, -1, -1 };
static structplatform_deviceti_st_device= {
.name = "kim",
.id = -1,
.dev.platform_data = &gpios,
};struct
platform_device*st_get_plat_device(void){ return &ti_st_device; }
EXPORT_SYMBOL(st_get_plat_device);static
__initintadd_ti_st_device(void){ platform_device_register(&ti_st_device); dev_info(&ti_st_device.dev,"registered platform TI ST device\n"); return 0; }
device_initcall(add_ti_st_device);Quoted 6 lines
Quoted 1 line
We have that in our local trees in
arch/arm/mach-omap2/board-sdp4430.cThanks for the explanation.
Is the driver platform-specific?
E.g., should it not even be built on x86?Yes. Requirement of the hardware is very much a must. However it is a separate peripheral (WiLink 7 - uart interfaced), may be there is a x86 platform with this - but certainly not desktops.
on linux-next, I generally put in that
st_dev.cfile for x86 - verify whether it builds as a module, inserts/rmmod, basic other functionalities (which doesn't involve response from chip..) But verify full functionality on board which constitutes that.Quoted 5 lines
Quoted 3 lines
Hi,
Please make this driver build cleanly on X86 or prevent it from being built there.Do you do something like a make allyesconfig?
I do 50 X86 randconfig builds per night (scripted, while I sleep). As long as STAGING is enabled and RFKILL is enabled, then
TI_STcan be enabled, so usually it fails to build.Quoted 2 lines
I am having a hard time figuring out why is it building for you in the first place? make defconfig doesn't build it, neither does make
i386_defconfig.That is irrelevant. It's now in mainline and it is causing build failures.
Quoted 1 line
May be a patch which does 'default N' in
drivers/staging/ti-st/Kconfig, would suffice?Nope.
Quoted 7 lines
Quoted 3 lines
Please suggest...
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
ERROR: "
st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!
st_get_plat_devicewill have to be defined for any build platform, or not referenced, or make it not possible to enableTI_STunlessst_get_plat_deviceis defined.
Quoted 6 lines
I was thinking as to why do I even have this platform device reference via an exported symbol,
and thanks for pointing out, I don't even need this function "st_get_plat_device()".
I already have theplatform_devicereference in my_probefunction !!!.. I will send out a patch 2morrow.
That's all good to hear.
Quoted 11 lines
This actually sorts of clarifies how I support multiple devices too... This is how my probe would then look like ...
static intkim_probe(struct platform_device *pdev)
{
....
...
platform_devices_i_have[id] = pdev;
.....
....
}
Quoted 6 lines
and
st_get_plat_device(int id)would be defined as... {
return platform_devices_i_have[id];
}Does this sound ok ?
Sounds OK, but let's see the patch (tomorrow).
thanks,
Signature · 2 lines
~Randy *** Remember to use Documentation/SubmitChecklist when testing your code ***