All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers:staging:ti-st: patches
@ 2010-09-10 19:58 pavan_savoy
  2010-09-10 19:58 ` [PATCH] drivers:staging:ti-st: fix kim platform device id pavan_savoy
  0 siblings, 1 reply; 13+ messages in thread
From: pavan_savoy @ 2010-09-10 19:58 UTC (permalink / raw)
  To: gregkh, alan; +Cc: devel, linux-kernel, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Greg,

There are 2 patch sets here,
1) fixes a problem - has only 1 patch
2) set of 3 patches subjected as RFCs

Please merge the patch below, and provide comments on the rest.

Pavan Savoy (1):
  drivers:staging:ti-st: fix kim platform device id

 drivers/staging/ti-st/st_kim.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

>From 801919830d6d707f4171a28720b3f4cc5348e192 Mon Sep 17 00:00:00 2001
From: Pavan Savoy <pavan_savoy@ti.com>
Date: Fri, 10 Sep 2010 14:43:03 -0400
Subject: [RFC 0/3] *** SUBJECT HERE ***

*** BLURB HERE ***

Pavan Savoy (3):
  drivers:staging:ti-st: mv headers to ti_wilink_st
  drivers:staging:ti-st: mv ti_wilink_st to include/
  include:linux: make ti_wilink_st like the rest

 drivers/staging/ti-st/bt_drv.c  |    2 +-
 drivers/staging/ti-st/fm.h      |   13 --
 drivers/staging/ti-st/st.h      |   83 --------
 drivers/staging/ti-st/st_core.c |   12 +-
 drivers/staging/ti-st/st_core.h |  128 ------------
 drivers/staging/ti-st/st_kim.c  |    8 +-
 drivers/staging/ti-st/st_kim.h  |  180 -----------------
 drivers/staging/ti-st/st_ll.c   |    6 +-
 drivers/staging/ti-st/st_ll.h   |   69 -------
 include/linux/ti_wilink_st.h    |  411 +++++++++++++++++++++++++++++++++++++++
 10 files changed, 421 insertions(+), 491 deletions(-)
 delete mode 100644 drivers/staging/ti-st/fm.h
 delete mode 100644 drivers/staging/ti-st/st.h
 delete mode 100644 drivers/staging/ti-st/st_core.h
 delete mode 100644 drivers/staging/ti-st/st_kim.h
 delete mode 100644 drivers/staging/ti-st/st_ll.h
 create mode 100644 include/linux/ti_wilink_st.h


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] drivers:staging:ti-st: fix kim platform device id
  2010-09-10 19:58 [PATCH] drivers:staging:ti-st: patches pavan_savoy
@ 2010-09-10 19:58 ` pavan_savoy
  2010-09-10 19:58   ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st pavan_savoy
                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: pavan_savoy @ 2010-09-10 19:58 UTC (permalink / raw)
  To: gregkh, alan; +Cc: devel, linux-kernel, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Platform devices tend to have id as -1 when only 1 device exist and
a value >=0 when multiple devices exist, since we plan to store all
these platform devices if multiple exist, there was a requirement to
have id to be >=0.
The patch fixes this problem.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/staging/ti-st/st_kim.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/ti-st/st_kim.c b/drivers/staging/ti-st/st_kim.c
index 9e99463..be18c7a 100644
--- a/drivers/staging/ti-st/st_kim.c
+++ b/drivers/staging/ti-st/st_kim.c
@@ -638,7 +638,14 @@ static int kim_probe(struct platform_device *pdev)
 	long *gpios = pdev->dev.platform_data;
 	struct kim_data_s	*kim_gdata;
 
-	st_kim_devices[pdev->id] = pdev;
+	if ((pdev->id != -1) && (pdev->id < MAX_ST_DEVICES)) {
+		/* multiple devices could exist */
+		st_kim_devices[pdev->id] = pdev;
+	} else {
+		/* platform's sure about existance of 1 device */
+		st_kim_devices[0] = pdev;
+	}
+
 	kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC);
 	if (!kim_gdata) {
 		pr_err("no mem to allocate");
-- 
1.6.5


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st
  2010-09-10 19:58 ` [PATCH] drivers:staging:ti-st: fix kim platform device id pavan_savoy
@ 2010-09-10 19:58   ` pavan_savoy
  2010-09-10 19:58     ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ pavan_savoy
  2010-09-16 19:56     ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st Greg KH
  2010-09-13 22:01   ` [PATCH] drivers:staging:ti-st: fix kim platform device id Savoy, Pavan
  2010-09-15 21:38   ` Savoy, Pavan
  2 siblings, 2 replies; 13+ messages in thread
From: pavan_savoy @ 2010-09-10 19:58 UTC (permalink / raw)
  To: gregkh, alan; +Cc: devel, linux-kernel, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Move all headers to st.h and rename st.h to be ti_wilink_st.h,
prepare the file to be moved to include/linux/ directory.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/staging/ti-st/fm.h      |   13 --
 drivers/staging/ti-st/st.h      |  318 +++++++++++++++++++++++++++++++++++++++
 drivers/staging/ti-st/st_core.c |    8 -
 drivers/staging/ti-st/st_core.h |  128 ----------------
 drivers/staging/ti-st/st_kim.c  |    6 +-
 drivers/staging/ti-st/st_kim.h  |  180 ----------------------
 drivers/staging/ti-st/st_ll.c   |    2 +-
 drivers/staging/ti-st/st_ll.h   |   69 ---------
 8 files changed, 321 insertions(+), 403 deletions(-)
 delete mode 100644 drivers/staging/ti-st/fm.h
 delete mode 100644 drivers/staging/ti-st/st_core.h
 delete mode 100644 drivers/staging/ti-st/st_kim.h
 delete mode 100644 drivers/staging/ti-st/st_ll.h

diff --git a/drivers/staging/ti-st/fm.h b/drivers/staging/ti-st/fm.h
deleted file mode 100644
index be41453..0000000
--- a/drivers/staging/ti-st/fm.h
+++ /dev/null
@@ -1,13 +0,0 @@
-struct fm_event_hdr {
-	unsigned char plen;
-} __attribute__ ((packed));
-
-#define FM_MAX_FRAME_SIZE 0xFF	/* TODO: */
-#define FM_EVENT_HDR_SIZE 1	/* size of fm_event_hdr */
-#define ST_FM_CH8_PKT 0x8
-
-/* gps stuff */
-struct gps_event_hdr {
-unsigned char opcode;
-unsigned short plen;
-} __attribute__ ((packed));
diff --git a/drivers/staging/ti-st/st.h b/drivers/staging/ti-st/st.h
index 1b3060e..c651903 100644
--- a/drivers/staging/ti-st/st.h
+++ b/drivers/staging/ti-st/st.h
@@ -80,4 +80,322 @@ struct st_proto_s {
 extern long st_register(struct st_proto_s *);
 extern long st_unregister(enum proto_type);
 
+/**
+ * structures and declarations used by the st_core.c
+ */
+/* states of protocol list */
+#define ST_NOTEMPTY	1
+#define ST_EMPTY	0
+
+/*
+ * possible st_states
+ */
+#define ST_INITIALIZING		1
+#define ST_REG_IN_PROGRESS	2
+#define ST_REG_PENDING		3
+#define ST_WAITING_FOR_RESP	4
+
+/**
+ * struct st_data_s - ST core internal structure
+ * @st_state: different states of ST like initializing, registration
+ *	in progress, this is mainly used to return relevant err codes
+ *	when protocol drivers are registering. It is also used to track
+ *	the recv function, as in during fw download only HCI events
+ *	can occur , where as during other times other events CH8, CH9
+ *	can occur.
+ * @tty: tty provided by the TTY core for line disciplines.
+ * @ldisc_ops: the procedures that this line discipline registers with TTY.
+ * @tx_skb: If for some reason the tty's write returns lesser bytes written
+ *	then to maintain the rest of data to be written on next instance.
+ *	This needs to be protected, hence the lock inside wakeup func.
+ * @tx_state: if the data is being written onto the TTY and protocol driver
+ *	wants to send more, queue up data and mark that there is
+ *	more data to send.
+ * @list: the list of protocols registered, only MAX can exist, one protocol
+ *	can register only once.
+ * @rx_state: states to be maintained inside st's tty receive
+ * @rx_count: count to be maintained inside st's tty receieve
+ * @rx_skb: the skb where all data for a protocol gets accumulated,
+ *	since tty might not call receive when a complete event packet
+ *	is received, the states, count and the skb needs to be maintained.
+ * @txq: the list of skbs which needs to be sent onto the TTY.
+ * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued
+ *	up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs
+ *	from waitq can be moved onto the txq.
+ *	Needs locking too.
+ * @lock: the lock to protect skbs, queues, and ST states.
+ * @protos_registered: count of the protocols registered, also when 0 the
+ *	chip enable gpio can be toggled, and when it changes to 1 the fw
+ *	needs to be downloaded to initialize chip side ST.
+ * @ll_state: the various PM states the chip can be, the states are notified
+ *	to us, when the chip sends relevant PM packets(SLEEP_IND, WAKE_IND).
+ * @kim_data: reference to the parent encapsulating structure.
+ *
+ */
+struct st_data_s {
+	unsigned long st_state;
+	struct tty_struct *tty;
+	struct tty_ldisc_ops *ldisc_ops;
+	struct sk_buff *tx_skb;
+#define ST_TX_SENDING	1
+#define ST_TX_WAKEUP	2
+	unsigned long tx_state;
+	struct st_proto_s *list[ST_MAX];
+	unsigned long rx_state;
+	unsigned long rx_count;
+	struct sk_buff *rx_skb;
+	struct sk_buff_head txq, tx_waitq;
+	spinlock_t lock;
+	unsigned char	protos_registered;
+	unsigned long ll_state;
+	void *kim_data;
+};
+
+/**
+ * st_int_write -
+ * point this to tty->driver->write or tty->ops->write
+ * depending upon the kernel version
+ */
+int st_int_write(struct st_data_s*, const unsigned char*, int);
+
+/**
+ * st_write -
+ * internal write function, passed onto protocol drivers
+ * via the write function ptr of protocol struct
+ */
+long st_write(struct sk_buff *);
+
+/* function to be called from ST-LL */
+void st_ll_send_frame(enum proto_type, struct sk_buff *);
+
+/* internal wake up function */
+void st_tx_wakeup(struct st_data_s *st_data);
+
+/* init, exit entry funcs called from KIM */
+int st_core_init(struct st_data_s **);
+void st_core_exit(struct st_data_s *);
+
+/* ask for reference from KIM */
+void st_kim_ref(struct st_data_s **, int);
+
+#define GPS_STUB_TEST
+#ifdef GPS_STUB_TEST
+int gps_chrdrv_stub_write(const unsigned char*, int);
+void gps_chrdrv_stub_init(void);
+#endif
+
+/**
+ * structures and declarations used by the st_kim.c
+ */
+
+/* time in msec to wait for
+ * line discipline to be installed
+ */
+#define LDISC_TIME	500
+#define CMD_RESP_TIME	500
+#define MAKEWORD(a, b)  ((unsigned short)(((unsigned char)(a)) \
+	| ((unsigned short)((unsigned char)(b))) << 8))
+
+#define GPIO_HIGH 1
+#define GPIO_LOW  0
+
+/* the Power-On-Reset logic, requires to attempt
+ * to download firmware onto chip more than once
+ * since the self-test for chip takes a while
+ */
+#define POR_RETRY_COUNT 5
+
+/**
+ * struct chip_version - save the chip version
+ */
+struct chip_version {
+	unsigned short full;
+	unsigned short chip;
+	unsigned short min_ver;
+	unsigned short maj_ver;
+};
+
+/**
+ * struct kim_data_s - the KIM internal data, embedded as the
+ *	platform's drv data. One for each ST device in the system.
+ * @uim_pid: KIM needs to communicate with UIM to request to install
+ *	the ldisc by opening UART when protocol drivers register.
+ * @kim_pdev: the platform device added in one of the board-XX.c file
+ *	in arch/XX/ directory, 1 for each ST device.
+ * @kim_rcvd: completion handler to notify when data was received,
+ *	mainly used during fw download, which involves multiple send/wait
+ *	for each of the HCI-VS commands.
+ * @ldisc_installed: completion handler to notify that the UIM accepted
+ *	the request to install ldisc, notify from tty_open which suggests
+ *	the ldisc was properly installed.
+ * @resp_buffer: data buffer for the .bts fw file name.
+ * @fw_entry: firmware class struct to request/release the fw.
+ * @gpios: the list of core/chip enable gpios for BT, FM and GPS cores.
+ * @rx_state: the rx state for kim's receive func during fw download.
+ * @rx_count: the rx count for the kim's receive func during fw download.
+ * @rx_skb: all of fw data might not come at once, and hence data storage for
+ *	whole of the fw response, only HCI_EVENTs and hence diff from ST's
+ *	response.
+ * @rfkill: rfkill data for each of the cores to be registered with rfkill.
+ * @rf_protos: proto types of the data registered with rfkill sub-system.
+ * @core_data: ST core's data, which mainly is the tty's disc_data
+ * @version: chip version available via a sysfs entry.
+ *
+ */
+struct kim_data_s {
+	long uim_pid;
+	struct platform_device *kim_pdev;
+	struct completion kim_rcvd, ldisc_installed;
+	char resp_buffer[30];
+	const struct firmware *fw_entry;
+	long gpios[ST_MAX];
+	unsigned long rx_state;
+	unsigned long rx_count;
+	struct sk_buff *rx_skb;
+	struct rfkill *rfkill[ST_MAX];
+	enum proto_type rf_protos[ST_MAX];
+	struct st_data_s *core_data;
+	struct chip_version version;
+};
+
+/**
+ * functions called when 1 of the protocol drivers gets
+ * registered, these need to communicate with UIM to request
+ * ldisc installed, read chip_version, download relevant fw
+ */
+long st_kim_start(void *);
+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 *, void *);
+
+/*
+ * BTS headers
+ */
+#define ACTION_SEND_COMMAND     1
+#define ACTION_WAIT_EVENT       2
+#define ACTION_SERIAL           3
+#define ACTION_DELAY            4
+#define ACTION_RUN_SCRIPT       5
+#define ACTION_REMARKS          6
+
+/**
+ * struct bts_header - the fw file is NOT binary which can
+ *	be sent onto TTY as is. The .bts is more a script
+ *	file which has different types of actions.
+ *	Each such action needs to be parsed by the KIM and
+ *	relevant procedure to be called.
+ */
+struct bts_header {
+	uint32_t magic;
+	uint32_t version;
+	uint8_t future[24];
+	uint8_t actions[0];
+} __attribute__ ((packed));
+
+/**
+ * struct bts_action - Each .bts action has its own type of
+ *	data.
+ */
+struct bts_action {
+	uint16_t type;
+	uint16_t size;
+	uint8_t data[0];
+} __attribute__ ((packed));
+
+struct bts_action_send {
+	uint8_t data[0];
+} __attribute__ ((packed));
+
+struct bts_action_wait {
+	uint32_t msec;
+	uint32_t size;
+	uint8_t data[0];
+} __attribute__ ((packed));
+
+struct bts_action_delay {
+	uint32_t msec;
+} __attribute__ ((packed));
+
+struct bts_action_serial {
+	uint32_t baud;
+	uint32_t flow_control;
+} __attribute__ ((packed));
+
+/**
+ * struct hci_command - the HCI-VS for intrepreting
+ *	the change baud rate of host-side UART, which
+ *	needs to be ignored, since UIM would do that
+ *	when it receives request from KIM for ldisc installation.
+ */
+struct hci_command {
+	uint8_t prefix;
+	uint16_t opcode;
+	uint8_t plen;
+	uint32_t speed;
+} __attribute__ ((packed));
+
+/**
+ * structure and declarations used by st_ll.c
+ */
+/* ST LL receiver states */
+#define ST_W4_PACKET_TYPE       0
+#define ST_BT_W4_EVENT_HDR      1
+#define ST_BT_W4_ACL_HDR        2
+#define ST_BT_W4_SCO_HDR        3
+#define ST_BT_W4_DATA           4
+#define ST_FM_W4_EVENT_HDR      5
+#define ST_GPS_W4_EVENT_HDR	6
+
+/* ST LL state machines */
+#define ST_LL_ASLEEP               0
+#define ST_LL_ASLEEP_TO_AWAKE      1
+#define ST_LL_AWAKE                2
+#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
+#define LL_WAKE_UP_ACK	0x33
+
+/* initialize and de-init ST LL */
+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
+ * 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 *);
+
+/**
+ * structures and declarations used by the st_core for FM packets
+ */
+struct fm_event_hdr {
+	unsigned char plen;
+} __attribute__ ((packed));
+
+#define FM_MAX_FRAME_SIZE 0xFF	/* TODO: */
+#define FM_EVENT_HDR_SIZE 1	/* size of fm_event_hdr */
+#define ST_FM_CH8_PKT 0x8
+
+/* gps stuff */
+struct gps_event_hdr {
+unsigned char opcode;
+unsigned short plen;
+} __attribute__ ((packed));
+
 #endif /* ST_H */
diff --git a/drivers/staging/ti-st/st_core.c b/drivers/staging/ti-st/st_core.c
index fad97d7..cd54dfb 100644
--- a/drivers/staging/ti-st/st_core.c
+++ b/drivers/staging/ti-st/st_core.c
@@ -28,14 +28,6 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/hci.h>
-#include "fm.h"
-/*
- * packet formats for fm and gps
- * #include "gps.h"
- */
-#include "st_core.h"
-#include "st_kim.h"
-#include "st_ll.h"
 #include "st.h"
 
 /* strings to be used for rfkill entries and by
diff --git a/drivers/staging/ti-st/st_core.h b/drivers/staging/ti-st/st_core.h
deleted file mode 100644
index 8601320..0000000
--- a/drivers/staging/ti-st/st_core.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *  Shared Transport Core header file
- *
- *  Copyright (C) 2009 Texas Instruments
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-#ifndef ST_CORE_H
-#define ST_CORE_H
-
-#include <linux/skbuff.h>
-#include "st.h"
-
-/* states of protocol list */
-#define ST_NOTEMPTY	1
-#define ST_EMPTY	0
-
-/*
- * possible st_states
- */
-#define ST_INITIALIZING		1
-#define ST_REG_IN_PROGRESS	2
-#define ST_REG_PENDING		3
-#define ST_WAITING_FOR_RESP	4
-
-/**
- * struct st_data_s - ST core internal structure
- * @st_state: different states of ST like initializing, registration
- *	in progress, this is mainly used to return relevant err codes
- *	when protocol drivers are registering. It is also used to track
- *	the recv function, as in during fw download only HCI events
- *	can occur , where as during other times other events CH8, CH9
- *	can occur.
- * @tty: tty provided by the TTY core for line disciplines.
- * @ldisc_ops: the procedures that this line discipline registers with TTY.
- * @tx_skb: If for some reason the tty's write returns lesser bytes written
- *	then to maintain the rest of data to be written on next instance.
- *	This needs to be protected, hence the lock inside wakeup func.
- * @tx_state: if the data is being written onto the TTY and protocol driver
- *	wants to send more, queue up data and mark that there is
- *	more data to send.
- * @list: the list of protocols registered, only MAX can exist, one protocol
- *	can register only once.
- * @rx_state: states to be maintained inside st's tty receive
- * @rx_count: count to be maintained inside st's tty receieve
- * @rx_skb: the skb where all data for a protocol gets accumulated,
- *	since tty might not call receive when a complete event packet
- *	is received, the states, count and the skb needs to be maintained.
- * @txq: the list of skbs which needs to be sent onto the TTY.
- * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued
- *	up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs
- *	from waitq can be moved onto the txq.
- *	Needs locking too.
- * @lock: the lock to protect skbs, queues, and ST states.
- * @protos_registered: count of the protocols registered, also when 0 the
- *	chip enable gpio can be toggled, and when it changes to 1 the fw
- *	needs to be downloaded to initialize chip side ST.
- * @ll_state: the various PM states the chip can be, the states are notified
- *	to us, when the chip sends relevant PM packets(SLEEP_IND, WAKE_IND).
- * @kim_data: reference to the parent encapsulating structure.
- *
- */
-struct st_data_s {
-	unsigned long st_state;
-	struct tty_struct *tty;
-	struct tty_ldisc_ops *ldisc_ops;
-	struct sk_buff *tx_skb;
-#define ST_TX_SENDING	1
-#define ST_TX_WAKEUP	2
-	unsigned long tx_state;
-	struct st_proto_s *list[ST_MAX];
-	unsigned long rx_state;
-	unsigned long rx_count;
-	struct sk_buff *rx_skb;
-	struct sk_buff_head txq, tx_waitq;
-	spinlock_t lock;
-	unsigned char	protos_registered;
-	unsigned long ll_state;
-	void *kim_data;
-};
-
-/**
- * st_int_write -
- * point this to tty->driver->write or tty->ops->write
- * depending upon the kernel version
- */
-int st_int_write(struct st_data_s*, const unsigned char*, int);
-
-/**
- * st_write -
- * internal write function, passed onto protocol drivers
- * via the write function ptr of protocol struct
- */
-long st_write(struct sk_buff *);
-
-/* function to be called from ST-LL */
-void st_ll_send_frame(enum proto_type, struct sk_buff *);
-
-/* internal wake up function */
-void st_tx_wakeup(struct st_data_s *st_data);
-
-/* init, exit entry funcs called from KIM */
-int st_core_init(struct st_data_s **);
-void st_core_exit(struct st_data_s *);
-
-/* ask for reference from KIM */
-void st_kim_ref(struct st_data_s **, int);
-
-#define GPS_STUB_TEST
-#ifdef GPS_STUB_TEST
-int gps_chrdrv_stub_write(const unsigned char*, int);
-void gps_chrdrv_stub_init(void);
-#endif
-
-#endif /*ST_CORE_H */
diff --git a/drivers/staging/ti-st/st_kim.c b/drivers/staging/ti-st/st_kim.c
index be18c7a..6a2e48c 100644
--- a/drivers/staging/ti-st/st_kim.c
+++ b/drivers/staging/ti-st/st_kim.c
@@ -28,15 +28,13 @@
 #include <linux/gpio.h>
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
-
 #include <linux/sched.h>
-
-#include "st_kim.h"
+#include <linux/rfkill.h>
 /* understand BT events for fw response */
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/hci.h>
-
+#include "st.h"
 
 static int kim_probe(struct platform_device *pdev);
 static int kim_remove(struct platform_device *pdev);
diff --git a/drivers/staging/ti-st/st_kim.h b/drivers/staging/ti-st/st_kim.h
deleted file mode 100644
index 7de2541..0000000
--- a/drivers/staging/ti-st/st_kim.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- *  Shared Transport Line discipline driver Core
- *	Init Manager Module header file
- *  Copyright (C) 2009 Texas Instruments
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-#ifndef ST_KIM_H
-#define ST_KIM_H
-
-#include <linux/types.h>
-#include "st.h"
-#include "st_core.h"
-#include "st_ll.h"
-#include <linux/rfkill.h>
-
-/* time in msec to wait for
- * line discipline to be installed
- */
-#define LDISC_TIME	500
-#define CMD_RESP_TIME	500
-#define MAKEWORD(a, b)  ((unsigned short)(((unsigned char)(a)) \
-	| ((unsigned short)((unsigned char)(b))) << 8))
-
-#define GPIO_HIGH 1
-#define GPIO_LOW  0
-
-/* the Power-On-Reset logic, requires to attempt
- * to download firmware onto chip more than once
- * since the self-test for chip takes a while
- */
-#define POR_RETRY_COUNT 5
-
-/**
- * struct chip_version - save the chip version
- */
-struct chip_version {
-	unsigned short full;
-	unsigned short chip;
-	unsigned short min_ver;
-	unsigned short maj_ver;
-};
-
-/**
- * struct kim_data_s - the KIM internal data, embedded as the
- *	platform's drv data. One for each ST device in the system.
- * @uim_pid: KIM needs to communicate with UIM to request to install
- *	the ldisc by opening UART when protocol drivers register.
- * @kim_pdev: the platform device added in one of the board-XX.c file
- *	in arch/XX/ directory, 1 for each ST device.
- * @kim_rcvd: completion handler to notify when data was received,
- *	mainly used during fw download, which involves multiple send/wait
- *	for each of the HCI-VS commands.
- * @ldisc_installed: completion handler to notify that the UIM accepted
- *	the request to install ldisc, notify from tty_open which suggests
- *	the ldisc was properly installed.
- * @resp_buffer: data buffer for the .bts fw file name.
- * @fw_entry: firmware class struct to request/release the fw.
- * @gpios: the list of core/chip enable gpios for BT, FM and GPS cores.
- * @rx_state: the rx state for kim's receive func during fw download.
- * @rx_count: the rx count for the kim's receive func during fw download.
- * @rx_skb: all of fw data might not come at once, and hence data storage for
- *	whole of the fw response, only HCI_EVENTs and hence diff from ST's
- *	response.
- * @rfkill: rfkill data for each of the cores to be registered with rfkill.
- * @rf_protos: proto types of the data registered with rfkill sub-system.
- * @core_data: ST core's data, which mainly is the tty's disc_data
- * @version: chip version available via a sysfs entry.
- *
- */
-struct kim_data_s {
-	long uim_pid;
-	struct platform_device *kim_pdev;
-	struct completion kim_rcvd, ldisc_installed;
-	char resp_buffer[30];
-	const struct firmware *fw_entry;
-	long gpios[ST_MAX];
-	unsigned long rx_state;
-	unsigned long rx_count;
-	struct sk_buff *rx_skb;
-	struct rfkill *rfkill[ST_MAX];
-	enum proto_type rf_protos[ST_MAX];
-	struct st_data_s *core_data;
-	struct chip_version version;
-};
-
-/**
- * functions called when 1 of the protocol drivers gets
- * registered, these need to communicate with UIM to request
- * ldisc installed, read chip_version, download relevant fw
- */
-long st_kim_start(void *);
-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 *, void *);
-
-/*
- * BTS headers
- */
-#define ACTION_SEND_COMMAND     1
-#define ACTION_WAIT_EVENT       2
-#define ACTION_SERIAL           3
-#define ACTION_DELAY            4
-#define ACTION_RUN_SCRIPT       5
-#define ACTION_REMARKS          6
-
-/**
- * struct bts_header - the fw file is NOT binary which can
- *	be sent onto TTY as is. The .bts is more a script
- *	file which has different types of actions.
- *	Each such action needs to be parsed by the KIM and
- *	relevant procedure to be called.
- */
-struct bts_header {
-	uint32_t magic;
-	uint32_t version;
-	uint8_t future[24];
-	uint8_t actions[0];
-} __attribute__ ((packed));
-
-/**
- * struct bts_action - Each .bts action has its own type of
- *	data.
- */
-struct bts_action {
-	uint16_t type;
-	uint16_t size;
-	uint8_t data[0];
-} __attribute__ ((packed));
-
-struct bts_action_send {
-	uint8_t data[0];
-} __attribute__ ((packed));
-
-struct bts_action_wait {
-	uint32_t msec;
-	uint32_t size;
-	uint8_t data[0];
-} __attribute__ ((packed));
-
-struct bts_action_delay {
-	uint32_t msec;
-} __attribute__ ((packed));
-
-struct bts_action_serial {
-	uint32_t baud;
-	uint32_t flow_control;
-} __attribute__ ((packed));
-
-/**
- * struct hci_command - the HCI-VS for intrepreting
- *	the change baud rate of host-side UART, which
- *	needs to be ignored, since UIM would do that
- *	when it receives request from KIM for ldisc installation.
- */
-struct hci_command {
-	uint8_t prefix;
-	uint16_t opcode;
-	uint8_t plen;
-	uint32_t speed;
-} __attribute__ ((packed));
-
-
-#endif /* ST_KIM_H */
diff --git a/drivers/staging/ti-st/st_ll.c b/drivers/staging/ti-st/st_ll.c
index 7a1fb6d..9bf56ab 100644
--- a/drivers/staging/ti-st/st_ll.c
+++ b/drivers/staging/ti-st/st_ll.c
@@ -19,7 +19,7 @@
  */
 
 #define pr_fmt(fmt) "(stll) :" fmt
-#include "st_ll.h"
+#include "st.h"
 
 /**********************************************************************/
 /* internal functions */
diff --git a/drivers/staging/ti-st/st_ll.h b/drivers/staging/ti-st/st_ll.h
deleted file mode 100644
index e4dfacd..0000000
--- a/drivers/staging/ti-st/st_ll.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *  Shared Transport Low Level (ST LL)
- *
- *  Copyright (C) 2009 Texas Instruments
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-#ifndef ST_LL_H
-#define ST_LL_H
-
-#include <linux/skbuff.h>
-#include "st.h"
-#include "st_core.h"
-
-/* ST LL receiver states */
-#define ST_W4_PACKET_TYPE       0
-#define ST_BT_W4_EVENT_HDR      1
-#define ST_BT_W4_ACL_HDR        2
-#define ST_BT_W4_SCO_HDR        3
-#define ST_BT_W4_DATA           4
-#define ST_FM_W4_EVENT_HDR      5
-#define ST_GPS_W4_EVENT_HDR	6
-
-/* ST LL state machines */
-#define ST_LL_ASLEEP               0
-#define ST_LL_ASLEEP_TO_AWAKE      1
-#define ST_LL_AWAKE                2
-#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
-#define LL_WAKE_UP_ACK	0x33
-
-/* initialize and de-init ST LL */
-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
- * 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 */
-- 
1.6.5


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/
  2010-09-10 19:58   ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st pavan_savoy
@ 2010-09-10 19:58     ` pavan_savoy
  2010-09-10 19:58       ` [RFC 3/3] include:linux: make ti_wilink_st like the rest pavan_savoy
  2010-09-16 19:57       ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ Greg KH
  2010-09-16 19:56     ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st Greg KH
  1 sibling, 2 replies; 13+ messages in thread
From: pavan_savoy @ 2010-09-10 19:58 UTC (permalink / raw)
  To: gregkh, alan; +Cc: devel, linux-kernel, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Move the ti_wilink_st header (previously st.h) to include/linux
directory. This header is to be included by all protocol drivers viz'
bluetooth drivers, FM V4L2 and GPS generic character device driver.
It also serves the core shared transport driver.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/staging/ti-st/bt_drv.c  |    2 +-
 drivers/staging/ti-st/st.h      |  401 --------------------------------------
 drivers/staging/ti-st/st_core.c |    4 +-
 drivers/staging/ti-st/st_kim.c  |    4 +-
 drivers/staging/ti-st/st_ll.c   |    4 +-
 include/linux/ti_wilink_st.h    |  404 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 411 insertions(+), 408 deletions(-)
 delete mode 100644 drivers/staging/ti-st/st.h
 create mode 100644 include/linux/ti_wilink_st.h

diff --git a/drivers/staging/ti-st/bt_drv.c b/drivers/staging/ti-st/bt_drv.c
index 61ae988..75065bf 100644
--- a/drivers/staging/ti-st/bt_drv.c
+++ b/drivers/staging/ti-st/bt_drv.c
@@ -24,7 +24,7 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 
-#include "st.h"
+#include <linux/ti_wilink_st.h>
 #include "bt_drv.h"
 
 /* Define this macro to get debug msg */
diff --git a/drivers/staging/ti-st/st.h b/drivers/staging/ti-st/st.h
deleted file mode 100644
index c651903..0000000
--- a/drivers/staging/ti-st/st.h
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- *  Shared Transport Header file
- *	To be included by the protocol stack drivers for
- *	Texas Instruments BT,FM and GPS combo chip drivers
- *
- *  Copyright (C) 2009 Texas Instruments
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-#ifndef ST_H
-#define ST_H
-
-#include <linux/skbuff.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 */
-
-/**
- * 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,
-};
-
-/**
- * enum proto-type - The protocol on WiLink chips which share a
- *	common physical interface like UART.
- */
-enum proto_type {
-	ST_BT,
-	ST_FM,
-	ST_GPS,
-	ST_MAX,
-};
-
-/**
- * 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.
- * @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) (void *, struct sk_buff *);
-	unsigned char (*match_packet) (const unsigned 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 *);
-extern long st_unregister(enum proto_type);
-
-/**
- * structures and declarations used by the st_core.c
- */
-/* states of protocol list */
-#define ST_NOTEMPTY	1
-#define ST_EMPTY	0
-
-/*
- * possible st_states
- */
-#define ST_INITIALIZING		1
-#define ST_REG_IN_PROGRESS	2
-#define ST_REG_PENDING		3
-#define ST_WAITING_FOR_RESP	4
-
-/**
- * struct st_data_s - ST core internal structure
- * @st_state: different states of ST like initializing, registration
- *	in progress, this is mainly used to return relevant err codes
- *	when protocol drivers are registering. It is also used to track
- *	the recv function, as in during fw download only HCI events
- *	can occur , where as during other times other events CH8, CH9
- *	can occur.
- * @tty: tty provided by the TTY core for line disciplines.
- * @ldisc_ops: the procedures that this line discipline registers with TTY.
- * @tx_skb: If for some reason the tty's write returns lesser bytes written
- *	then to maintain the rest of data to be written on next instance.
- *	This needs to be protected, hence the lock inside wakeup func.
- * @tx_state: if the data is being written onto the TTY and protocol driver
- *	wants to send more, queue up data and mark that there is
- *	more data to send.
- * @list: the list of protocols registered, only MAX can exist, one protocol
- *	can register only once.
- * @rx_state: states to be maintained inside st's tty receive
- * @rx_count: count to be maintained inside st's tty receieve
- * @rx_skb: the skb where all data for a protocol gets accumulated,
- *	since tty might not call receive when a complete event packet
- *	is received, the states, count and the skb needs to be maintained.
- * @txq: the list of skbs which needs to be sent onto the TTY.
- * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued
- *	up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs
- *	from waitq can be moved onto the txq.
- *	Needs locking too.
- * @lock: the lock to protect skbs, queues, and ST states.
- * @protos_registered: count of the protocols registered, also when 0 the
- *	chip enable gpio can be toggled, and when it changes to 1 the fw
- *	needs to be downloaded to initialize chip side ST.
- * @ll_state: the various PM states the chip can be, the states are notified
- *	to us, when the chip sends relevant PM packets(SLEEP_IND, WAKE_IND).
- * @kim_data: reference to the parent encapsulating structure.
- *
- */
-struct st_data_s {
-	unsigned long st_state;
-	struct tty_struct *tty;
-	struct tty_ldisc_ops *ldisc_ops;
-	struct sk_buff *tx_skb;
-#define ST_TX_SENDING	1
-#define ST_TX_WAKEUP	2
-	unsigned long tx_state;
-	struct st_proto_s *list[ST_MAX];
-	unsigned long rx_state;
-	unsigned long rx_count;
-	struct sk_buff *rx_skb;
-	struct sk_buff_head txq, tx_waitq;
-	spinlock_t lock;
-	unsigned char	protos_registered;
-	unsigned long ll_state;
-	void *kim_data;
-};
-
-/**
- * st_int_write -
- * point this to tty->driver->write or tty->ops->write
- * depending upon the kernel version
- */
-int st_int_write(struct st_data_s*, const unsigned char*, int);
-
-/**
- * st_write -
- * internal write function, passed onto protocol drivers
- * via the write function ptr of protocol struct
- */
-long st_write(struct sk_buff *);
-
-/* function to be called from ST-LL */
-void st_ll_send_frame(enum proto_type, struct sk_buff *);
-
-/* internal wake up function */
-void st_tx_wakeup(struct st_data_s *st_data);
-
-/* init, exit entry funcs called from KIM */
-int st_core_init(struct st_data_s **);
-void st_core_exit(struct st_data_s *);
-
-/* ask for reference from KIM */
-void st_kim_ref(struct st_data_s **, int);
-
-#define GPS_STUB_TEST
-#ifdef GPS_STUB_TEST
-int gps_chrdrv_stub_write(const unsigned char*, int);
-void gps_chrdrv_stub_init(void);
-#endif
-
-/**
- * structures and declarations used by the st_kim.c
- */
-
-/* time in msec to wait for
- * line discipline to be installed
- */
-#define LDISC_TIME	500
-#define CMD_RESP_TIME	500
-#define MAKEWORD(a, b)  ((unsigned short)(((unsigned char)(a)) \
-	| ((unsigned short)((unsigned char)(b))) << 8))
-
-#define GPIO_HIGH 1
-#define GPIO_LOW  0
-
-/* the Power-On-Reset logic, requires to attempt
- * to download firmware onto chip more than once
- * since the self-test for chip takes a while
- */
-#define POR_RETRY_COUNT 5
-
-/**
- * struct chip_version - save the chip version
- */
-struct chip_version {
-	unsigned short full;
-	unsigned short chip;
-	unsigned short min_ver;
-	unsigned short maj_ver;
-};
-
-/**
- * struct kim_data_s - the KIM internal data, embedded as the
- *	platform's drv data. One for each ST device in the system.
- * @uim_pid: KIM needs to communicate with UIM to request to install
- *	the ldisc by opening UART when protocol drivers register.
- * @kim_pdev: the platform device added in one of the board-XX.c file
- *	in arch/XX/ directory, 1 for each ST device.
- * @kim_rcvd: completion handler to notify when data was received,
- *	mainly used during fw download, which involves multiple send/wait
- *	for each of the HCI-VS commands.
- * @ldisc_installed: completion handler to notify that the UIM accepted
- *	the request to install ldisc, notify from tty_open which suggests
- *	the ldisc was properly installed.
- * @resp_buffer: data buffer for the .bts fw file name.
- * @fw_entry: firmware class struct to request/release the fw.
- * @gpios: the list of core/chip enable gpios for BT, FM and GPS cores.
- * @rx_state: the rx state for kim's receive func during fw download.
- * @rx_count: the rx count for the kim's receive func during fw download.
- * @rx_skb: all of fw data might not come at once, and hence data storage for
- *	whole of the fw response, only HCI_EVENTs and hence diff from ST's
- *	response.
- * @rfkill: rfkill data for each of the cores to be registered with rfkill.
- * @rf_protos: proto types of the data registered with rfkill sub-system.
- * @core_data: ST core's data, which mainly is the tty's disc_data
- * @version: chip version available via a sysfs entry.
- *
- */
-struct kim_data_s {
-	long uim_pid;
-	struct platform_device *kim_pdev;
-	struct completion kim_rcvd, ldisc_installed;
-	char resp_buffer[30];
-	const struct firmware *fw_entry;
-	long gpios[ST_MAX];
-	unsigned long rx_state;
-	unsigned long rx_count;
-	struct sk_buff *rx_skb;
-	struct rfkill *rfkill[ST_MAX];
-	enum proto_type rf_protos[ST_MAX];
-	struct st_data_s *core_data;
-	struct chip_version version;
-};
-
-/**
- * functions called when 1 of the protocol drivers gets
- * registered, these need to communicate with UIM to request
- * ldisc installed, read chip_version, download relevant fw
- */
-long st_kim_start(void *);
-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 *, void *);
-
-/*
- * BTS headers
- */
-#define ACTION_SEND_COMMAND     1
-#define ACTION_WAIT_EVENT       2
-#define ACTION_SERIAL           3
-#define ACTION_DELAY            4
-#define ACTION_RUN_SCRIPT       5
-#define ACTION_REMARKS          6
-
-/**
- * struct bts_header - the fw file is NOT binary which can
- *	be sent onto TTY as is. The .bts is more a script
- *	file which has different types of actions.
- *	Each such action needs to be parsed by the KIM and
- *	relevant procedure to be called.
- */
-struct bts_header {
-	uint32_t magic;
-	uint32_t version;
-	uint8_t future[24];
-	uint8_t actions[0];
-} __attribute__ ((packed));
-
-/**
- * struct bts_action - Each .bts action has its own type of
- *	data.
- */
-struct bts_action {
-	uint16_t type;
-	uint16_t size;
-	uint8_t data[0];
-} __attribute__ ((packed));
-
-struct bts_action_send {
-	uint8_t data[0];
-} __attribute__ ((packed));
-
-struct bts_action_wait {
-	uint32_t msec;
-	uint32_t size;
-	uint8_t data[0];
-} __attribute__ ((packed));
-
-struct bts_action_delay {
-	uint32_t msec;
-} __attribute__ ((packed));
-
-struct bts_action_serial {
-	uint32_t baud;
-	uint32_t flow_control;
-} __attribute__ ((packed));
-
-/**
- * struct hci_command - the HCI-VS for intrepreting
- *	the change baud rate of host-side UART, which
- *	needs to be ignored, since UIM would do that
- *	when it receives request from KIM for ldisc installation.
- */
-struct hci_command {
-	uint8_t prefix;
-	uint16_t opcode;
-	uint8_t plen;
-	uint32_t speed;
-} __attribute__ ((packed));
-
-/**
- * structure and declarations used by st_ll.c
- */
-/* ST LL receiver states */
-#define ST_W4_PACKET_TYPE       0
-#define ST_BT_W4_EVENT_HDR      1
-#define ST_BT_W4_ACL_HDR        2
-#define ST_BT_W4_SCO_HDR        3
-#define ST_BT_W4_DATA           4
-#define ST_FM_W4_EVENT_HDR      5
-#define ST_GPS_W4_EVENT_HDR	6
-
-/* ST LL state machines */
-#define ST_LL_ASLEEP               0
-#define ST_LL_ASLEEP_TO_AWAKE      1
-#define ST_LL_AWAKE                2
-#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
-#define LL_WAKE_UP_ACK	0x33
-
-/* initialize and de-init ST LL */
-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
- * 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 *);
-
-/**
- * structures and declarations used by the st_core for FM packets
- */
-struct fm_event_hdr {
-	unsigned char plen;
-} __attribute__ ((packed));
-
-#define FM_MAX_FRAME_SIZE 0xFF	/* TODO: */
-#define FM_EVENT_HDR_SIZE 1	/* size of fm_event_hdr */
-#define ST_FM_CH8_PKT 0x8
-
-/* gps stuff */
-struct gps_event_hdr {
-unsigned char opcode;
-unsigned short plen;
-} __attribute__ ((packed));
-
-#endif /* ST_H */
diff --git a/drivers/staging/ti-st/st_core.c b/drivers/staging/ti-st/st_core.c
index cd54dfb..5da2514 100644
--- a/drivers/staging/ti-st/st_core.c
+++ b/drivers/staging/ti-st/st_core.c
@@ -1,7 +1,7 @@
 /*
  *  Shared Transport Line discipline driver Core
  *	This hooks up ST KIM driver and ST LL driver
- *  Copyright (C) 2009 Texas Instruments
+ *  Copyright (C) 2009-2010 Texas Instruments
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
@@ -28,7 +28,7 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/hci.h>
-#include "st.h"
+#include <linux/ti_wilink_st.h>
 
 /* strings to be used for rfkill entries and by
  * ST Core to be used for sysfs debug entry
diff --git a/drivers/staging/ti-st/st_kim.c b/drivers/staging/ti-st/st_kim.c
index 6a2e48c..7a75947 100644
--- a/drivers/staging/ti-st/st_kim.c
+++ b/drivers/staging/ti-st/st_kim.c
@@ -2,7 +2,7 @@
  *  Shared Transport Line discipline driver Core
  *	Init Manager module responsible for GPIO control
  *	and firmware download
- *  Copyright (C) 2009 Texas Instruments
+ *  Copyright (C) 2009-2010 Texas Instruments
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
@@ -34,7 +34,7 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/hci.h>
-#include "st.h"
+#include <linux/ti_wilink_st.h>
 
 static int kim_probe(struct platform_device *pdev);
 static int kim_remove(struct platform_device *pdev);
diff --git a/drivers/staging/ti-st/st_ll.c b/drivers/staging/ti-st/st_ll.c
index 9bf56ab..e899920 100644
--- a/drivers/staging/ti-st/st_ll.c
+++ b/drivers/staging/ti-st/st_ll.c
@@ -1,7 +1,7 @@
 /*
  *  Shared Transport driver
  *	HCI-LL module responsible for TI proprietary HCI_LL protocol
- *  Copyright (C) 2009 Texas Instruments
+ *  Copyright (C) 2009-2010 Texas Instruments
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
@@ -19,7 +19,7 @@
  */
 
 #define pr_fmt(fmt) "(stll) :" fmt
-#include "st.h"
+#include <linux/ti_wilink_st.h>
 
 /**********************************************************************/
 /* internal functions */
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
new file mode 100644
index 0000000..df8d2ee
--- /dev/null
+++ b/include/linux/ti_wilink_st.h
@@ -0,0 +1,404 @@
+/*
+ *  TI WiLink Shared Transport Header
+ *	Texas Instrument's WiLink connectivity chipsets which packs 4
+ *	technologies BT, FM, GPS and WLAN on 1 chip.
+ *	The BT, FM and GPS share a common UART physical interface and this
+ *	driver serves the shared transport driver for it.
+ *
+ *  Copyright (C) 2009-2010 Texas Instruments
+ *  Author: Pavan Savoy <pavan_savoy@ti.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef ST_H
+#define ST_H
+
+#include <linux/skbuff.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 */
+
+/**
+ * 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,
+};
+
+/**
+ * enum proto-type - The protocol on WiLink chips which share a
+ *	common physical interface like UART.
+ */
+enum proto_type {
+	ST_BT,
+	ST_FM,
+	ST_GPS,
+	ST_MAX,
+};
+
+/**
+ * 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.
+ * @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) (void *, struct sk_buff *);
+	unsigned char (*match_packet) (const unsigned 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 *);
+extern long st_unregister(enum proto_type);
+
+/**
+ * structures and declarations used by the st_core.c
+ */
+/* states of protocol list */
+#define ST_NOTEMPTY	1
+#define ST_EMPTY	0
+
+/*
+ * possible st_states
+ */
+#define ST_INITIALIZING		1
+#define ST_REG_IN_PROGRESS	2
+#define ST_REG_PENDING		3
+#define ST_WAITING_FOR_RESP	4
+
+/**
+ * struct st_data_s - ST core internal structure
+ * @st_state: different states of ST like initializing, registration
+ *	in progress, this is mainly used to return relevant err codes
+ *	when protocol drivers are registering. It is also used to track
+ *	the recv function, as in during fw download only HCI events
+ *	can occur , where as during other times other events CH8, CH9
+ *	can occur.
+ * @tty: tty provided by the TTY core for line disciplines.
+ * @ldisc_ops: the procedures that this line discipline registers with TTY.
+ * @tx_skb: If for some reason the tty's write returns lesser bytes written
+ *	then to maintain the rest of data to be written on next instance.
+ *	This needs to be protected, hence the lock inside wakeup func.
+ * @tx_state: if the data is being written onto the TTY and protocol driver
+ *	wants to send more, queue up data and mark that there is
+ *	more data to send.
+ * @list: the list of protocols registered, only MAX can exist, one protocol
+ *	can register only once.
+ * @rx_state: states to be maintained inside st's tty receive
+ * @rx_count: count to be maintained inside st's tty receieve
+ * @rx_skb: the skb where all data for a protocol gets accumulated,
+ *	since tty might not call receive when a complete event packet
+ *	is received, the states, count and the skb needs to be maintained.
+ * @txq: the list of skbs which needs to be sent onto the TTY.
+ * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued
+ *	up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs
+ *	from waitq can be moved onto the txq.
+ *	Needs locking too.
+ * @lock: the lock to protect skbs, queues, and ST states.
+ * @protos_registered: count of the protocols registered, also when 0 the
+ *	chip enable gpio can be toggled, and when it changes to 1 the fw
+ *	needs to be downloaded to initialize chip side ST.
+ * @ll_state: the various PM states the chip can be, the states are notified
+ *	to us, when the chip sends relevant PM packets(SLEEP_IND, WAKE_IND).
+ * @kim_data: reference to the parent encapsulating structure.
+ *
+ */
+struct st_data_s {
+	unsigned long st_state;
+	struct tty_struct *tty;
+	struct tty_ldisc_ops *ldisc_ops;
+	struct sk_buff *tx_skb;
+#define ST_TX_SENDING	1
+#define ST_TX_WAKEUP	2
+	unsigned long tx_state;
+	struct st_proto_s *list[ST_MAX];
+	unsigned long rx_state;
+	unsigned long rx_count;
+	struct sk_buff *rx_skb;
+	struct sk_buff_head txq, tx_waitq;
+	spinlock_t lock;
+	unsigned char	protos_registered;
+	unsigned long ll_state;
+	void *kim_data;
+};
+
+/**
+ * st_int_write -
+ * point this to tty->driver->write or tty->ops->write
+ * depending upon the kernel version
+ */
+int st_int_write(struct st_data_s*, const unsigned char*, int);
+
+/**
+ * st_write -
+ * internal write function, passed onto protocol drivers
+ * via the write function ptr of protocol struct
+ */
+long st_write(struct sk_buff *);
+
+/* function to be called from ST-LL */
+void st_ll_send_frame(enum proto_type, struct sk_buff *);
+
+/* internal wake up function */
+void st_tx_wakeup(struct st_data_s *st_data);
+
+/* init, exit entry funcs called from KIM */
+int st_core_init(struct st_data_s **);
+void st_core_exit(struct st_data_s *);
+
+/* ask for reference from KIM */
+void st_kim_ref(struct st_data_s **, int);
+
+#define GPS_STUB_TEST
+#ifdef GPS_STUB_TEST
+int gps_chrdrv_stub_write(const unsigned char*, int);
+void gps_chrdrv_stub_init(void);
+#endif
+
+/**
+ * structures and declarations used by the st_kim.c
+ */
+
+/* time in msec to wait for
+ * line discipline to be installed
+ */
+#define LDISC_TIME	500
+#define CMD_RESP_TIME	500
+#define MAKEWORD(a, b)  ((unsigned short)(((unsigned char)(a)) \
+	| ((unsigned short)((unsigned char)(b))) << 8))
+
+#define GPIO_HIGH 1
+#define GPIO_LOW  0
+
+/* the Power-On-Reset logic, requires to attempt
+ * to download firmware onto chip more than once
+ * since the self-test for chip takes a while
+ */
+#define POR_RETRY_COUNT 5
+
+/**
+ * struct chip_version - save the chip version
+ */
+struct chip_version {
+	unsigned short full;
+	unsigned short chip;
+	unsigned short min_ver;
+	unsigned short maj_ver;
+};
+
+/**
+ * struct kim_data_s - the KIM internal data, embedded as the
+ *	platform's drv data. One for each ST device in the system.
+ * @uim_pid: KIM needs to communicate with UIM to request to install
+ *	the ldisc by opening UART when protocol drivers register.
+ * @kim_pdev: the platform device added in one of the board-XX.c file
+ *	in arch/XX/ directory, 1 for each ST device.
+ * @kim_rcvd: completion handler to notify when data was received,
+ *	mainly used during fw download, which involves multiple send/wait
+ *	for each of the HCI-VS commands.
+ * @ldisc_installed: completion handler to notify that the UIM accepted
+ *	the request to install ldisc, notify from tty_open which suggests
+ *	the ldisc was properly installed.
+ * @resp_buffer: data buffer for the .bts fw file name.
+ * @fw_entry: firmware class struct to request/release the fw.
+ * @gpios: the list of core/chip enable gpios for BT, FM and GPS cores.
+ * @rx_state: the rx state for kim's receive func during fw download.
+ * @rx_count: the rx count for the kim's receive func during fw download.
+ * @rx_skb: all of fw data might not come at once, and hence data storage for
+ *	whole of the fw response, only HCI_EVENTs and hence diff from ST's
+ *	response.
+ * @rfkill: rfkill data for each of the cores to be registered with rfkill.
+ * @rf_protos: proto types of the data registered with rfkill sub-system.
+ * @core_data: ST core's data, which mainly is the tty's disc_data
+ * @version: chip version available via a sysfs entry.
+ *
+ */
+struct kim_data_s {
+	long uim_pid;
+	struct platform_device *kim_pdev;
+	struct completion kim_rcvd, ldisc_installed;
+	char resp_buffer[30];
+	const struct firmware *fw_entry;
+	long gpios[ST_MAX];
+	unsigned long rx_state;
+	unsigned long rx_count;
+	struct sk_buff *rx_skb;
+	struct rfkill *rfkill[ST_MAX];
+	enum proto_type rf_protos[ST_MAX];
+	struct st_data_s *core_data;
+	struct chip_version version;
+};
+
+/**
+ * functions called when 1 of the protocol drivers gets
+ * registered, these need to communicate with UIM to request
+ * ldisc installed, read chip_version, download relevant fw
+ */
+long st_kim_start(void *);
+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 *, void *);
+
+/*
+ * BTS headers
+ */
+#define ACTION_SEND_COMMAND     1
+#define ACTION_WAIT_EVENT       2
+#define ACTION_SERIAL           3
+#define ACTION_DELAY            4
+#define ACTION_RUN_SCRIPT       5
+#define ACTION_REMARKS          6
+
+/**
+ * struct bts_header - the fw file is NOT binary which can
+ *	be sent onto TTY as is. The .bts is more a script
+ *	file which has different types of actions.
+ *	Each such action needs to be parsed by the KIM and
+ *	relevant procedure to be called.
+ */
+struct bts_header {
+	uint32_t magic;
+	uint32_t version;
+	uint8_t future[24];
+	uint8_t actions[0];
+} __attribute__ ((packed));
+
+/**
+ * struct bts_action - Each .bts action has its own type of
+ *	data.
+ */
+struct bts_action {
+	uint16_t type;
+	uint16_t size;
+	uint8_t data[0];
+} __attribute__ ((packed));
+
+struct bts_action_send {
+	uint8_t data[0];
+} __attribute__ ((packed));
+
+struct bts_action_wait {
+	uint32_t msec;
+	uint32_t size;
+	uint8_t data[0];
+} __attribute__ ((packed));
+
+struct bts_action_delay {
+	uint32_t msec;
+} __attribute__ ((packed));
+
+struct bts_action_serial {
+	uint32_t baud;
+	uint32_t flow_control;
+} __attribute__ ((packed));
+
+/**
+ * struct hci_command - the HCI-VS for intrepreting
+ *	the change baud rate of host-side UART, which
+ *	needs to be ignored, since UIM would do that
+ *	when it receives request from KIM for ldisc installation.
+ */
+struct hci_command {
+	uint8_t prefix;
+	uint16_t opcode;
+	uint8_t plen;
+	uint32_t speed;
+} __attribute__ ((packed));
+
+/**
+ * structure and declarations used by st_ll.c
+ */
+/* ST LL receiver states */
+#define ST_W4_PACKET_TYPE       0
+#define ST_BT_W4_EVENT_HDR      1
+#define ST_BT_W4_ACL_HDR        2
+#define ST_BT_W4_SCO_HDR        3
+#define ST_BT_W4_DATA           4
+#define ST_FM_W4_EVENT_HDR      5
+#define ST_GPS_W4_EVENT_HDR	6
+
+/* ST LL state machines */
+#define ST_LL_ASLEEP               0
+#define ST_LL_ASLEEP_TO_AWAKE      1
+#define ST_LL_AWAKE                2
+#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
+#define LL_WAKE_UP_ACK	0x33
+
+/* initialize and de-init ST LL */
+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
+ * 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 *);
+
+/**
+ * structures and declarations used by the st_core for FM packets
+ */
+struct fm_event_hdr {
+	unsigned char plen;
+} __attribute__ ((packed));
+
+#define FM_MAX_FRAME_SIZE 0xFF	/* TODO: */
+#define FM_EVENT_HDR_SIZE 1	/* size of fm_event_hdr */
+#define ST_FM_CH8_PKT 0x8
+
+/* gps stuff */
+struct gps_event_hdr {
+unsigned char opcode;
+unsigned short plen;
+} __attribute__ ((packed));
+
+#endif /* ST_H */
-- 
1.6.5


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC 3/3] include:linux: make ti_wilink_st like the rest
  2010-09-10 19:58     ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ pavan_savoy
@ 2010-09-10 19:58       ` pavan_savoy
  2010-09-16 20:00         ` Greg KH
  2010-09-16 19:57       ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ Greg KH
  1 sibling, 1 reply; 13+ messages in thread
From: pavan_savoy @ 2010-09-10 19:58 UTC (permalink / raw)
  To: gregkh, alan; +Cc: devel, linux-kernel, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

ti_wilink_st.h now is similar to other headers in include/linux.
The st_ll dependency on ti_wilink_st is also fixed.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/staging/ti-st/st_ll.c |    2 +
 include/linux/ti_wilink_st.h  |   51 +++++++++++++++++++++++-----------------
 2 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/ti-st/st_ll.c b/drivers/staging/ti-st/st_ll.c
index e899920..15e4028 100644
--- a/drivers/staging/ti-st/st_ll.c
+++ b/drivers/staging/ti-st/st_ll.c
@@ -19,6 +19,8 @@
  */
 
 #define pr_fmt(fmt) "(stll) :" fmt
+#include <linux/module.h>
+#include <linux/skbuff.h>
 #include <linux/ti_wilink_st.h>
 
 /**********************************************************************/
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
index df8d2ee..a563e09 100644
--- a/include/linux/ti_wilink_st.h
+++ b/include/linux/ti_wilink_st.h
@@ -26,12 +26,18 @@
 #ifndef ST_H
 #define ST_H
 
-#include <linux/skbuff.h>
+#ifdef __KERNEL__
+#include <linux/skbuff.h>	/* for sk_buff */
+#include <linux/rfkill.h>	/* for rfkill */
+#include <linux/tty.h>		/* for tty_struct */
+#include <linux/tty_ldisc.h>	/* for tty_ldisc_ops */
+
+#endif
 
 /* TODO:
  * Move the following to tty.h upon acceptance
  */
-#define N_TI_WL	20	/* Ldisc for TI's WL BT, FM, GPS combo chips */
+#define N_TI_WL	22	/* Ldisc for TI's WL BT, FM, GPS combo chips */
 
 /**
  * enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW
@@ -292,10 +298,10 @@ void kim_st_list_protocols(struct st_data_s *, void *);
  *	relevant procedure to be called.
  */
 struct bts_header {
-	uint32_t magic;
-	uint32_t version;
-	uint8_t future[24];
-	uint8_t actions[0];
+	unsigned long magic;
+	unsigned long version;
+	unsigned char future[24];
+	unsigned char actions[0];
 } __attribute__ ((packed));
 
 /**
@@ -303,28 +309,28 @@ struct bts_header {
  *	data.
  */
 struct bts_action {
-	uint16_t type;
-	uint16_t size;
-	uint8_t data[0];
+	unsigned short type;
+	unsigned short size;
+	unsigned char data[0];
 } __attribute__ ((packed));
 
 struct bts_action_send {
-	uint8_t data[0];
+	unsigned char data[0];
 } __attribute__ ((packed));
 
 struct bts_action_wait {
-	uint32_t msec;
-	uint32_t size;
-	uint8_t data[0];
+	unsigned long msec;
+	unsigned long size;
+	unsigned char data[0];
 } __attribute__ ((packed));
 
 struct bts_action_delay {
-	uint32_t msec;
+	unsigned long msec;
 } __attribute__ ((packed));
 
 struct bts_action_serial {
-	uint32_t baud;
-	uint32_t flow_control;
+	unsigned long baud;
+	unsigned long flow_control;
 } __attribute__ ((packed));
 
 /**
@@ -334,10 +340,10 @@ struct bts_action_serial {
  *	when it receives request from KIM for ldisc installation.
  */
 struct hci_command {
-	uint8_t prefix;
-	uint16_t opcode;
-	uint8_t plen;
-	uint32_t speed;
+	unsigned char prefix;
+	unsigned short opcode;
+	unsigned char plen;
+	unsigned long speed;
 } __attribute__ ((packed));
 
 /**
@@ -386,6 +392,7 @@ void st_ll_wakeup(struct st_data_s *);
 
 /**
  * structures and declarations used by the st_core for FM packets
+ * and GPS packets
  */
 struct fm_event_hdr {
 	unsigned char plen;
@@ -397,8 +404,8 @@ struct fm_event_hdr {
 
 /* gps stuff */
 struct gps_event_hdr {
-unsigned char opcode;
-unsigned short plen;
+	unsigned char opcode;
+	unsigned short plen;
 } __attribute__ ((packed));
 
 #endif /* ST_H */
-- 
1.6.5


^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] drivers:staging:ti-st: fix kim platform device id
  2010-09-10 19:58 ` [PATCH] drivers:staging:ti-st: fix kim platform device id pavan_savoy
  2010-09-10 19:58   ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st pavan_savoy
@ 2010-09-13 22:01   ` Savoy, Pavan
  2010-09-15 21:38   ` Savoy, Pavan
  2 siblings, 0 replies; 13+ messages in thread
From: Savoy, Pavan @ 2010-09-13 22:01 UTC (permalink / raw)
  To: gregkh, alan; +Cc: devel, linux-kernel

Greg,

 
----------------
Thanks & Regards,
Pavan Savoy | x0099669
 
> -----Original Message-----
> From: Savoy, Pavan
> Sent: Friday, September 10, 2010 2:59 PM
> To: gregkh@suse.de; alan@lxorguk.ukuu.org.uk
> Cc: devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org; Savoy, Pavan
> Subject: [PATCH] drivers:staging:ti-st: fix kim platform device id
> 
> From: Pavan Savoy <pavan_savoy@ti.com>
> 
> Platform devices tend to have id as -1 when only 1 device exist and
> a value >=0 when multiple devices exist, since we plan to store all
> these platform devices if multiple exist, there was a requirement to
> have id to be >=0.
> The patch fixes this problem.

Please merge this patch, and I hope you find some time to review the rest of them.


> Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
> ---
>  drivers/staging/ti-st/st_kim.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/ti-st/st_kim.c b/drivers/staging/ti-st/st_kim.c
> index 9e99463..be18c7a 100644
> --- a/drivers/staging/ti-st/st_kim.c
> +++ b/drivers/staging/ti-st/st_kim.c
> @@ -638,7 +638,14 @@ static int kim_probe(struct platform_device *pdev)
>  	long *gpios = pdev->dev.platform_data;
>  	struct kim_data_s	*kim_gdata;
> 
> -	st_kim_devices[pdev->id] = pdev;
> +	if ((pdev->id != -1) && (pdev->id < MAX_ST_DEVICES)) {
> +		/* multiple devices could exist */
> +		st_kim_devices[pdev->id] = pdev;
> +	} else {
> +		/* platform's sure about existance of 1 device */
> +		st_kim_devices[0] = pdev;
> +	}
> +
>  	kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC);
>  	if (!kim_gdata) {
>  		pr_err("no mem to allocate");
> --
> 1.6.5


^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] drivers:staging:ti-st: fix kim platform device id
  2010-09-10 19:58 ` [PATCH] drivers:staging:ti-st: fix kim platform device id pavan_savoy
  2010-09-10 19:58   ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st pavan_savoy
  2010-09-13 22:01   ` [PATCH] drivers:staging:ti-st: fix kim platform device id Savoy, Pavan
@ 2010-09-15 21:38   ` Savoy, Pavan
  2 siblings, 0 replies; 13+ messages in thread
From: Savoy, Pavan @ 2010-09-15 21:38 UTC (permalink / raw)
  To: Savoy, Pavan, gregkh, alan; +Cc: devel, linux-kernel


Greg,

Any updates?
Please ... Please find some time to have a look at it!!

Alan,

Please have a look at it too. I've dealt with most of the comments, device context has been provided, spin-locks have been reviewed and documented multiple devices also can be easily supported if required.

 

> -----Original Message-----
> From: Savoy, Pavan
> Sent: Monday, September 13, 2010 5:02 PM
> To: gregkh@suse.de; alan@lxorguk.ukuu.org.uk
> Cc: devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org
> Subject: RE: [PATCH] drivers:staging:ti-st: fix kim platform device id
> 
> Greg,
> 
> 
> ----------------
> Thanks & Regards,
> Pavan Savoy | x0099669
> 
> > -----Original Message-----
> > From: Savoy, Pavan
> > Sent: Friday, September 10, 2010 2:59 PM
> > To: gregkh@suse.de; alan@lxorguk.ukuu.org.uk
> > Cc: devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org; Savoy, Pavan
> > Subject: [PATCH] drivers:staging:ti-st: fix kim platform device id
> >
> > From: Pavan Savoy <pavan_savoy@ti.com>
> >
> > Platform devices tend to have id as -1 when only 1 device exist and
> > a value >=0 when multiple devices exist, since we plan to store all
> > these platform devices if multiple exist, there was a requirement to
> > have id to be >=0.
> > The patch fixes this problem.
> 
> Please merge this patch, and I hope you find some time to review the rest of
> them.
> 
> 
> > Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
> > ---
> >  drivers/staging/ti-st/st_kim.c |    9 ++++++++-
> >  1 files changed, 8 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/staging/ti-st/st_kim.c b/drivers/staging/ti-st/st_kim.c
> > index 9e99463..be18c7a 100644
> > --- a/drivers/staging/ti-st/st_kim.c
> > +++ b/drivers/staging/ti-st/st_kim.c
> > @@ -638,7 +638,14 @@ static int kim_probe(struct platform_device *pdev)
> >  	long *gpios = pdev->dev.platform_data;
> >  	struct kim_data_s	*kim_gdata;
> >
> > -	st_kim_devices[pdev->id] = pdev;
> > +	if ((pdev->id != -1) && (pdev->id < MAX_ST_DEVICES)) {
> > +		/* multiple devices could exist */
> > +		st_kim_devices[pdev->id] = pdev;
> > +	} else {
> > +		/* platform's sure about existance of 1 device */
> > +		st_kim_devices[0] = pdev;
> > +	}
> > +
> >  	kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC);
> >  	if (!kim_gdata) {
> >  		pr_err("no mem to allocate");
> > --
> > 1.6.5


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st
  2010-09-10 19:58   ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st pavan_savoy
  2010-09-10 19:58     ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ pavan_savoy
@ 2010-09-16 19:56     ` Greg KH
  1 sibling, 0 replies; 13+ messages in thread
From: Greg KH @ 2010-09-16 19:56 UTC (permalink / raw)
  To: pavan_savoy; +Cc: gregkh, alan, devel, linux-kernel

On Fri, Sep 10, 2010 at 03:58:56PM -0400, pavan_savoy@ti.com wrote:
> From: Pavan Savoy <pavan_savoy@ti.com>
> 
> Move all headers to st.h and rename st.h to be ti_wilink_st.h,
> prepare the file to be moved to include/linux/ directory.

Why does the file need to be in include/linux/ at all?  Can't it just
live in the same directory as the drivers?

And this patch doesn't rename st.h to be anything else.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/
  2010-09-10 19:58     ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ pavan_savoy
  2010-09-10 19:58       ` [RFC 3/3] include:linux: make ti_wilink_st like the rest pavan_savoy
@ 2010-09-16 19:57       ` Greg KH
  1 sibling, 0 replies; 13+ messages in thread
From: Greg KH @ 2010-09-16 19:57 UTC (permalink / raw)
  To: pavan_savoy; +Cc: gregkh, alan, devel, linux-kernel

On Fri, Sep 10, 2010 at 03:58:57PM -0400, pavan_savoy@ti.com wrote:
> From: Pavan Savoy <pavan_savoy@ti.com>
> 
> Move the ti_wilink_st header (previously st.h) to include/linux
> directory. This header is to be included by all protocol drivers viz'
> bluetooth drivers, FM V4L2 and GPS generic character device driver.
> It also serves the core shared transport driver.

Ah, so the individual drivers will be in the different parts of the
kernel?  Like drivers/char and other places?  That makes sense why they
should be using a file in include/linux/

But just make the file that name now, in the staging directory.  That
way when we move the code out, it's easier to do so (we don't have to do
this 3 patch series.)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 3/3] include:linux: make ti_wilink_st like the rest
  2010-09-10 19:58       ` [RFC 3/3] include:linux: make ti_wilink_st like the rest pavan_savoy
@ 2010-09-16 20:00         ` Greg KH
  2010-09-16 20:18           ` Savoy, Pavan
  0 siblings, 1 reply; 13+ messages in thread
From: Greg KH @ 2010-09-16 20:00 UTC (permalink / raw)
  To: pavan_savoy; +Cc: gregkh, alan, devel, linux-kernel

On Fri, Sep 10, 2010 at 03:58:58PM -0400, pavan_savoy@ti.com wrote:
> From: Pavan Savoy <pavan_savoy@ti.com>
> 
> ti_wilink_st.h now is similar to other headers in include/linux.
> The st_ll dependency on ti_wilink_st is also fixed.
> 
> Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
> ---
>  drivers/staging/ti-st/st_ll.c |    2 +
>  include/linux/ti_wilink_st.h  |   51 +++++++++++++++++++++++-----------------
>  2 files changed, 31 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/staging/ti-st/st_ll.c b/drivers/staging/ti-st/st_ll.c
> index e899920..15e4028 100644
> --- a/drivers/staging/ti-st/st_ll.c
> +++ b/drivers/staging/ti-st/st_ll.c
> @@ -19,6 +19,8 @@
>   */
>  
>  #define pr_fmt(fmt) "(stll) :" fmt
> +#include <linux/module.h>
> +#include <linux/skbuff.h>

Why is this needed?  Does it fix something that broke in patch 2/3?  If
so, fix it in that patch please.

>  #include <linux/ti_wilink_st.h>
>  
>  /**********************************************************************/
> diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
> index df8d2ee..a563e09 100644
> --- a/include/linux/ti_wilink_st.h
> +++ b/include/linux/ti_wilink_st.h
> @@ -26,12 +26,18 @@
>  #ifndef ST_H
>  #define ST_H
>  
> -#include <linux/skbuff.h>
> +#ifdef __KERNEL__
> +#include <linux/skbuff.h>	/* for sk_buff */
> +#include <linux/rfkill.h>	/* for rfkill */
> +#include <linux/tty.h>		/* for tty_struct */
> +#include <linux/tty_ldisc.h>	/* for tty_ldisc_ops */

Are these really needed?  Can't you include them in the .c files that
need to include this .h file instead?

> +
> +#endif

I don't think you need this #ifdef, do you?  Are you really exporting
this file to userspace for some reason?  If so, what reason?

>  
>  /* TODO:
>   * Move the following to tty.h upon acceptance
>   */
> -#define N_TI_WL	20	/* Ldisc for TI's WL BT, FM, GPS combo chips */
> +#define N_TI_WL	22	/* Ldisc for TI's WL BT, FM, GPS combo chips */

Why did this change?

>  
>  /**
>   * enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW
> @@ -292,10 +298,10 @@ void kim_st_list_protocols(struct st_data_s *, void *);
>   *	relevant procedure to be called.
>   */
>  struct bts_header {
> -	uint32_t magic;
> -	uint32_t version;
> -	uint8_t future[24];
> -	uint8_t actions[0];
> +	unsigned long magic;
> +	unsigned long version;
> +	unsigned char future[24];
> +	unsigned char actions[0];

Why change these now?  That should happen some other place in the
series, not here.  Especially as you don't mention anything like this in
the changelog comment.

Also, why not just use 'u8' and friends instead?  That's the "proper"
kernel types to be using, not the uint8_t mess that is not correct
kernel types.

> @@ -386,6 +392,7 @@ void st_ll_wakeup(struct st_data_s *);
>  
>  /**
>   * structures and declarations used by the st_core for FM packets
> + * and GPS packets
>   */
>  struct fm_event_hdr {
>  	unsigned char plen;

Oh, is it?  That should go somewhere else.

> @@ -397,8 +404,8 @@ struct fm_event_hdr {
>  
>  /* gps stuff */
>  struct gps_event_hdr {
> -unsigned char opcode;
> -unsigned short plen;
> +	unsigned char opcode;
> +	unsigned short plen;
>  } __attribute__ ((packed));

This should be done somewhere else, it's a formatting patch.

>  
>  #endif /* ST_H */

I don't think this file is called "ST_H" here anymore.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [RFC 3/3] include:linux: make ti_wilink_st like the rest
  2010-09-16 20:00         ` Greg KH
@ 2010-09-16 20:18           ` Savoy, Pavan
  2010-09-16 20:59             ` Greg KH
  0 siblings, 1 reply; 13+ messages in thread
From: Savoy, Pavan @ 2010-09-16 20:18 UTC (permalink / raw)
  To: Greg KH; +Cc: gregkh, alan, devel, linux-kernel


Greg,

 
> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Thursday, September 16, 2010 3:01 PM
> To: Savoy, Pavan
> Cc: gregkh@suse.de; alan@lxorguk.ukuu.org.uk; devel@driverdev.osuosl.org;
> linux-kernel@vger.kernel.org
> Subject: Re: [RFC 3/3] include:linux: make ti_wilink_st like the rest
> 
> On Fri, Sep 10, 2010 at 03:58:58PM -0400, pavan_savoy@ti.com wrote:
> > From: Pavan Savoy <pavan_savoy@ti.com>
> >
> > ti_wilink_st.h now is similar to other headers in include/linux.
> > The st_ll dependency on ti_wilink_st is also fixed.
> >
> > Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
> > ---
> >  drivers/staging/ti-st/st_ll.c |    2 +
> >  include/linux/ti_wilink_st.h  |   51 +++++++++++++++++++++++---------------
> --
> >  2 files changed, 31 insertions(+), 22 deletions(-)
> >
> > diff --git a/drivers/staging/ti-st/st_ll.c b/drivers/staging/ti-st/st_ll.c
> > index e899920..15e4028 100644
> > --- a/drivers/staging/ti-st/st_ll.c
> > +++ b/drivers/staging/ti-st/st_ll.c
> > @@ -19,6 +19,8 @@
> >   */
> >
> >  #define pr_fmt(fmt) "(stll) :" fmt
> > +#include <linux/module.h>
> > +#include <linux/skbuff.h>
> 
> Why is this needed?  Does it fix something that broke in patch 2/3?  If
> so, fix it in that patch please.

Hnm, I don't think they are needed. Must be a mistake will correct it.

> >  #include <linux/ti_wilink_st.h>
> >
> >  /**********************************************************************/
> > diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
> > index df8d2ee..a563e09 100644
> > --- a/include/linux/ti_wilink_st.h
> > +++ b/include/linux/ti_wilink_st.h
> > @@ -26,12 +26,18 @@
> >  #ifndef ST_H
> >  #define ST_H
> >
> > -#include <linux/skbuff.h>
> > +#ifdef __KERNEL__
> > +#include <linux/skbuff.h>	/* for sk_buff */
> > +#include <linux/rfkill.h>	/* for rfkill */
> > +#include <linux/tty.h>		/* for tty_struct */
> > +#include <linux/tty_ldisc.h>	/* for tty_ldisc_ops */
> 
> Are these really needed?  Can't you include them in the .c files that
> need to include this .h file instead?

Yes, that was the idea, but then just including these without including the headers here, we get tons of errors, although it shouldn't happen.
Had a look at other headers which sort of did something similar.

> > +
> > +#endif
> 
> I don't think you need this #ifdef, do you?  Are you really exporting
> this file to userspace for some reason?  If so, what reason?

For line discipline number only.
There will be a user-space daemon which when requested (via rfkill) opens the UART, sets the baud-rate to both local and chip side and installs the line discipline.

> >
> >  /* TODO:
> >   * Move the following to tty.h upon acceptance
> >   */
> > -#define N_TI_WL	20	/* Ldisc for TI's WL BT, FM, GPS combo chips */
> > +#define N_TI_WL	22	/* Ldisc for TI's WL BT, FM, GPS combo chips */
> 
> Why did this change?

Yes the number of line disciplines has grown since I last submitted a patch :)

> >
> >  /**
> >   * enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW
> > @@ -292,10 +298,10 @@ void kim_st_list_protocols(struct st_data_s *, void
> *);
> >   *	relevant procedure to be called.
> >   */
> >  struct bts_header {
> > -	uint32_t magic;
> > -	uint32_t version;
> > -	uint8_t future[24];
> > -	uint8_t actions[0];
> > +	unsigned long magic;
> > +	unsigned long version;
> > +	unsigned char future[24];
> > +	unsigned char actions[0];
> 
> Why change these now?  That should happen some other place in the
> series, not here.  Especially as you don't mention anything like this in
> the changelog comment.
> 
> Also, why not just use 'u8' and friends instead?  That's the "proper"
> kernel types to be using, not the uint8_t mess that is not correct
> kernel types.

Yes a mistake here too.
This should have been in the patch where I plan to combine all the headers into 1 header and have it in include/linux/
[the headers like st_core.h, st_kim.h, st_ll.h, bt_drv.h and fm and GPs headers]

Yes, and the Bluetooth driver to go into drivers/Bluetooth/ and ST driver (st_core.c/st_kim.c and st_ll.c) to go into drivers/char/
And the upcoming FM V4L2 to go into the drivers/media/radio/

Does this sound fine?

> > @@ -386,6 +392,7 @@ void st_ll_wakeup(struct st_data_s *);
> >
> >  /**
> >   * structures and declarations used by the st_core for FM packets
> > + * and GPS packets
> >   */
> >  struct fm_event_hdr {
> >  	unsigned char plen;
> 
> Oh, is it?  That should go somewhere else.

Plan is to have just 1 large header to be included by all protocol drivers (BT, FM and GPS)...
Is it a bad idea?

> > @@ -397,8 +404,8 @@ struct fm_event_hdr {
> >
> >  /* gps stuff */
> >  struct gps_event_hdr {
> > -unsigned char opcode;
> > -unsigned short plen;
> > +	unsigned char opcode;
> > +	unsigned short plen;
> >  } __attribute__ ((packed));
> 
> This should be done somewhere else, it's a formatting patch.

Yes, I'll do it in another patch.

> >
> >  #endif /* ST_H */
> 
> I don't think this file is called "ST_H" here anymore.

Yes, need your input here. This file will be made use by the rest of the protocol drivers I plan to push patches for.
So does ti_wilink_st.h sound fine? And in include/linux? So that rest of the drivers can be in their individual directories.

Thanks,
Pavan

> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 3/3] include:linux: make ti_wilink_st like the rest
  2010-09-16 20:18           ` Savoy, Pavan
@ 2010-09-16 20:59             ` Greg KH
  2010-09-16 21:24               ` Savoy, Pavan
  0 siblings, 1 reply; 13+ messages in thread
From: Greg KH @ 2010-09-16 20:59 UTC (permalink / raw)
  To: Savoy, Pavan; +Cc: gregkh, alan, devel, linux-kernel

On Fri, Sep 17, 2010 at 01:48:53AM +0530, Savoy, Pavan wrote:
> > Also, why not just use 'u8' and friends instead?  That's the "proper"
> > kernel types to be using, not the uint8_t mess that is not correct
> > kernel types.
> 
> Yes a mistake here too.
> This should have been in the patch where I plan to combine all the headers into 1 header and have it in include/linux/
> [the headers like st_core.h, st_kim.h, st_ll.h, bt_drv.h and fm and GPs headers]
> 
> Yes, and the Bluetooth driver to go into drivers/Bluetooth/ and ST
> driver (st_core.c/st_kim.c and st_ll.c) to go into drivers/char/ And
> the upcoming FM V4L2 to go into the drivers/media/radio/
> 
> Does this sound fine?

Yes.

> > > @@ -386,6 +392,7 @@ void st_ll_wakeup(struct st_data_s *);
> > >
> > >  /**
> > >   * structures and declarations used by the st_core for FM packets
> > > + * and GPS packets
> > >   */
> > >  struct fm_event_hdr {
> > >  	unsigned char plen;
> > 
> > Oh, is it?  That should go somewhere else.
> 
> Plan is to have just 1 large header to be included by all protocol drivers (BT, FM and GPS)...
> Is it a bad idea?

No, as long as all drivers need it.

> > >  #endif /* ST_H */
> > 
> > I don't think this file is called "ST_H" here anymore.
> 
> Yes, need your input here. This file will be made use by the rest of
> the protocol drivers I plan to push patches for.
> So does ti_wilink_st.h sound fine? And in include/linux? So that rest
> of the drivers can be in their individual directories.

Yes, that name is fine, but it needs to be the same as the #ifdef
guard as well.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [RFC 3/3] include:linux: make ti_wilink_st like the rest
  2010-09-16 20:59             ` Greg KH
@ 2010-09-16 21:24               ` Savoy, Pavan
  0 siblings, 0 replies; 13+ messages in thread
From: Savoy, Pavan @ 2010-09-16 21:24 UTC (permalink / raw)
  To: Greg KH; +Cc: gregkh, alan, devel, linux-kernel

Greg,

> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Thursday, September 16, 2010 3:59 PM
> To: Savoy, Pavan
> Cc: gregkh@suse.de; alan@lxorguk.ukuu.org.uk; devel@driverdev.osuosl.org;
> linux-kernel@vger.kernel.org
> Subject: Re: [RFC 3/3] include:linux: make ti_wilink_st like the rest
> 
> On Fri, Sep 17, 2010 at 01:48:53AM +0530, Savoy, Pavan wrote:
> > > Also, why not just use 'u8' and friends instead?  That's the "proper"
> > > kernel types to be using, not the uint8_t mess that is not correct
> > > kernel types.
> >
> > Yes a mistake here too.
> > This should have been in the patch where I plan to combine all the headers
> into 1 header and have it in include/linux/
> > [the headers like st_core.h, st_kim.h, st_ll.h, bt_drv.h and fm and GPs
> headers]
> >
> > Yes, and the Bluetooth driver to go into drivers/Bluetooth/ and ST
> > driver (st_core.c/st_kim.c and st_ll.c) to go into drivers/char/ And
> > the upcoming FM V4L2 to go into the drivers/media/radio/
> >
> > Does this sound fine?
> 
> Yes.
> 
> > > > @@ -386,6 +392,7 @@ void st_ll_wakeup(struct st_data_s *);
> > > >
> > > >  /**
> > > >   * structures and declarations used by the st_core for FM packets
> > > > + * and GPS packets
> > > >   */
> > > >  struct fm_event_hdr {
> > > >  	unsigned char plen;
> > >
> > > Oh, is it?  That should go somewhere else.
> >
> > Plan is to have just 1 large header to be included by all protocol drivers
> (BT, FM and GPS)...
> > Is it a bad idea?
> 
> No, as long as all drivers need it.
> 
> > > >  #endif /* ST_H */
> > >
> > > I don't think this file is called "ST_H" here anymore.
> >
> > Yes, need your input here. This file will be made use by the rest of
> > the protocol drivers I plan to push patches for.
> > So does ti_wilink_st.h sound fine? And in include/linux? So that rest
> > of the drivers can be in their individual directories.
> 
> Yes, that name is fine, but it needs to be the same as the #ifdef
> guard as well.


I've re-worked on the patch;
I hope now it's close to ready to be in include/linux/?

> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-09-16 21:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 19:58 [PATCH] drivers:staging:ti-st: patches pavan_savoy
2010-09-10 19:58 ` [PATCH] drivers:staging:ti-st: fix kim platform device id pavan_savoy
2010-09-10 19:58   ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st pavan_savoy
2010-09-10 19:58     ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ pavan_savoy
2010-09-10 19:58       ` [RFC 3/3] include:linux: make ti_wilink_st like the rest pavan_savoy
2010-09-16 20:00         ` Greg KH
2010-09-16 20:18           ` Savoy, Pavan
2010-09-16 20:59             ` Greg KH
2010-09-16 21:24               ` Savoy, Pavan
2010-09-16 19:57       ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ Greg KH
2010-09-16 19:56     ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st Greg KH
2010-09-13 22:01   ` [PATCH] drivers:staging:ti-st: fix kim platform device id Savoy, Pavan
2010-09-15 21:38   ` Savoy, Pavan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.