Commit Graph

28 Commits

Author SHA1 Message Date
Pavan Savoy 83ef41f085 staging: ti-st: mv headers to ti_wilink_st
move all the header information to ti_wilink_st.h.
This header would then not only serve the local modules like the st_core.c,
st_kim.c and st_ll.c but also the external modules/protocol drivers that are
dependent on the shared transport driver.
Modify the source files to include the new header ti_wilink_st.h,

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:02:54 -07:00
Pavan Savoy 5d702ea319 staging: ti-st: set right the data types
replace uint and family by a much more proper u8/u16 types.
This is required specifically for data members of structures coming
in from the chip and data members parsed from the binary firmware file.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:02:54 -07:00
Pavan Savoy dfb7ef7d84 staging: ti-st: fix kim platform device id
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:54:45 -07:00
Randy Dunlap 2427924cb0 staging: ST_BT depends on RFKILL
Fix kconfig unmet dependency warning:

warning: (ST_BT && STAGING && !STAGING_EXCLUDE_BUILD && BT) selects TI_ST which has unmet direct dependencies (RFKILL)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:32 -07:00
Pavan Savoy dbd3a87095 Staging: ti-st: remove st_get_plat_device
In order to support multiple ST platform devices, a new symbol
'st_get_plat_device' earlier needed to be exported by the arch/XX/brd-XX.c
file which intends to add the ST platform device.

On removing this dependency, now inside ST driver maintain the array of
ST platform devices that would be registered.
As of now let id=0, as and when we end up having such platforms
where mutliple ST devices can exist, id would come from
protocol drivers (BT, FM and GPS) as to on which platform device
they want to register to.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 15:11:20 -07:00
Dan Carpenter 0b6e7220ed Staging: ti-st: writing past end of array
In the original source it would write past the end of the array before
returning the error code.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 14:48:09 -07:00
Pavan Savoy b12d1995f6 Staging: ti-st: update TODO
Removed TODO item 2 :
Current UIM/KIM communicate via the rfkill device and identified by the unique idx
assisgned by the rfkill sub-system to each of these rfkill entries.

Removed TODO item 1 :
Since there is no way we can test existance of multiple connectivity
devices on  platform.
However the basic infrastructure as in providing a context to ST driver
exist.
If multiple devices have to exist on a given platform, multiple ST
platform devices need to be registered and each of the protocol drivers
have to mention which platform device they want to bind to/make use of.

Removed TODO item 3:
Locking have been reviewed and commit
36b5aee46b documents locking.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 18:28:40 -07:00
Pavan Savoy 9f912212cd Staging: ti-st: update ABI and TODO
update TODO to reflect the items taken care of,
update ABI to reflect the new debugfs entries exposed.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:20:56 -07:00
Pavan Savoy c1afac1502 Staging: ti-st: mv sysfs entries to debugfs
When the chip is in use, information like the chip's ROM version and the
protocols currently making use of the chip needs to be made known to
user-space.
Earlier the version and the protocol-list were exposed as sysfs entries
now cleanup by making them as debugfs entries, also in process remove
any unwanted/previously unused sysfs entries.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:20:56 -07:00
Pavan Savoy bb8f3c061f Staging: ti-st: give proto drivers context
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.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 12:07:28 -07:00
Pavan Savoy 36b5aee46b Staging: ti-st: cleanup code comments
cleanup the code commenting in the headers/structures,
also cleanup few inline commenting in the function

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 12:07:28 -07:00
Pavan Savoy e6d9e64e36 Staging: ti-st: smarten, reduce logs
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..)

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 12:07:27 -07:00
Pavan Savoy 320920cba3 Staging: ti-st: make use of linux err codes
remove custom error code definitions from the header and
make use of the agreed upon linux error codes.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 12:06:14 -07:00
Pavan Savoy 38d9df499d Staging: ti-st: remove global references
Providing a context which can be passed around the driver, the KIM's platform
driver's struct device to be used to dev_set_drvdata and dev_get_drvdata.
The ST core's data is passed around using tty's disc_data and in other
cases the ST KIM's platform device is exposed from the board-XX.c which
adds KIM platform device whose dev is used.

Thereby remove the need for the global reference struct kim_data_s *kim_gdata;

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08 12:26:49 -07:00
Pavan Savoy bd289d441e Staging: ti-st: Update TODO
An important TODO was to remove global references in TI-ST driver,
thereby providing a context to the driver.
This should also serve as a small step in removal of the single device
limit.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08 12:26:49 -07:00
Andrea Gelmini 6c2bfdc77f Staging: ti-st: Fix a typo in the Kconfig file
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-23 15:26:28 -07:00
Naveen Jain 36e574fed5 Staging: ti-st: fix protocol counting
Older mechanism of counting the number of protocols
registered with ST was slow, in-efficient.
It used to check the protocol data for NULL for each
registration/unregistration.

With this change, counting protocols in maintained by
a single counter protos_registered.

Counting protocols is not just for debug purposes

Signed-off-by: Naveen Jain <naveen_jain@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:40:29 -07:00
Naveen Jain e2a5328285 Staging: ti-st: add version info to sysfs
Add version information to be available under the sysfs group
for kim.

Signed-off-by: Naveen Jain <naveen_jain@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:39:38 -07:00
Naveen Jain b38fc2d965 Staging: ti-st: cleanup sysfs code
Remove the older way of communicating with user-space
daemon UIM.
The older way involved creating of a new kobj and pid
sysfs file under it, and sending signal using that pid.

Now we communicate via rfkill to user-space UIM.

Background: UIM is the user-space daemon which upon
notification from ldisc driver, opens the tty, sets
default baud and then installs (tiocsetd) the ldisc.

Signed-off-by: Naveen Jain <naveen_jain@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:39:37 -07:00
Pavan Savoy 4f62e69b2b Staging: Update TI-ST's TODO
Update the TODO of TI-ST to make sure it reflects current list
of activities that need to be done.
Also point it out to the user-space app code relevant to it.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:37:57 -07:00
Randy Dunlap dd7ad5c808 staging: ti-st: depends on RFKILL
Fix build errors.  st_kim.c uses rfkill*() interfaces, so it
should depend on RFKILL.

st_kim.c:(.text+0x291b21): undefined reference to `rfkill_unregister'
st_kim.c:(.text+0x291b31): undefined reference to `rfkill_destroy'
st_kim.c:(.text+0x291d8a): undefined reference to `rfkill_alloc'
st_kim.c:(.text+0x291db9): undefined reference to `rfkill_init_sw_state'
st_kim.c:(.text+0x291dc9): undefined reference to `rfkill_register'
st_kim.c:(.text+0x291e07): undefined reference to `rfkill_unregister'
(.text+0x291e85): undefined reference to `rfkill_set_hw_state'
(.text+0x292072): undefined reference to `rfkill_set_hw_state'
(.text+0x2920e1): undefined reference to `rfkill_set_hw_state

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 14:15:34 -07:00
Pavan Savoy 2f6aee5646 Staging: Kconfig, Makefile for TI's ST ldisc
This change adds the Kconfig and Make file for TI's
ST line discipline driver and the BlueZ driver for BT
core of the TI BT/FM/GPS combo chip.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
2010-05-11 11:35:56 -07:00
Pavan Savoy 70ddf80ac4 Staging: bluetooth: BT driver using ST for TI combo devices
This is BlueZ driver making use of Shared Transport line
discipline to communicate with the chip.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:56 -07:00
Pavan Savoy dfcbb616e8 Staging: add TODO and ABI to ti-st
A TODO file and a ABI to list the things to be done,
and user-space/kernel-space interface for this ldisc.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:56 -07:00
Pavan Savoy 69f6e06db9 Staging: sources for ST header file
Texas Instruments BT, FM and GPS combo chips/drivers
make use of a single TTY to communicate with the chip.
This is the common header file for both the ST driver and the
protocol drivers which intend to use ST as their mode of
transport.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:55 -07:00
Pavan Savoy 1d065ab683 Staging: sources for HCI LL PM protocol
Texas Instruments BT, FM and GPS combo chips/drivers
make use of a single TTY to communicate with the chip.
This module constitutes the proprietary power management
protocol from TI for the BT/FM/GPS combo chips

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:55 -07:00
Pavan Savoy d0088ce183 Staging: sources for Init manager module
Kernel Space Init-Manager works along with User-Mode
Init Manager daemon running to maintain the UART state.

Communication between user-space daemon and this module can be
	1. Via the pid written onto sysfs entry
	2. Via the rfkill subsystem

It also is a platform driver with a relevant platform device
in the board-*.c along with the list of BT/FM/GPS chip enable
gpio configuration

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:55 -07:00
Pavan Savoy 53618cc1e5 Staging: sources for ST core
Texas Instruments BT, FM and GPS combo chips/drivers
make use of a single TTY to communicate with the chip.
This module constitutes the core logic, TTY ldisc driver
and the exported symbols for registering/unregistering of
the protocol drivers such as BT/FM/GPS.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:55 -07:00