Device Driver Interface of WiLink Solution

From OMAPpedia

(Difference between revisions)
Jump to: navigation, search
(On boot check)
(Enabling profiles on Android)
Line 99: Line 99:
== Enabling profiles on Android ==
== Enabling profiles on Android ==
<ul>
<ul>
-
<li> GAP - Generic Access Profile
+
<li> GAP - Generic Access Profile<br>
Bluetooth-Settings under Wireless Setting menu of the Setting Application in Android, allows you to Scan, Pair and Connect to
Bluetooth-Settings under Wireless Setting menu of the Setting Application in Android, allows you to Scan, Pair and Connect to
devices, upon Scanning, the type of device is detected by Android and connection is made upon user's request.
devices, upon Scanning, the type of device is detected by Android and connection is made upon user's request.
-
<li> A2DP - Audio Streaming via Bluetooth
+
<li> A2DP - Audio Streaming via Bluetooth<br>
This is one of those profiles, which has android has support for in its profile and is expected to work out of the box as
This is one of those profiles, which has android has support for in its profile and is expected to work out of the box as
soon as you have Bluetooth working. Apart from the baud-rate on UART no other factor should generally cause the A2DP
soon as you have Bluetooth working. Apart from the baud-rate on UART no other factor should generally cause the A2DP
profile to break on android.
profile to break on android.
-
<li> AVRCP - Audio Video Remote Control Profile
+
<li> AVRCP - Audio Video Remote Control Profile<br>
This requires the uInput to be enabled in the kernel  - make menuconfig for more details.
This requires the uInput to be enabled in the kernel  - make menuconfig for more details.
-
<li> HFP/HSP - Head Set and Hands Free (In-Call operation)
+
<li> HFP/HSP - Head Set and Hands Free (In-Call operation)<br>
While all other kind of bluetooth data goes over UART, this one goes over from the OMAP, to the BT via the McBSP.
While all other kind of bluetooth data goes over UART, this one goes over from the OMAP, to the BT via the McBSP.
Different platforms have different configurations for the McBSP that has been interfaced with BT-PCM lines.
Different platforms have different configurations for the McBSP that has been interfaced with BT-PCM lines.
-
<li> HID -
+
Even without the Modem, the BT-PCM lines are verified by streaming music and record voice from the BT-headset.
 +
<li> HID <br>
On connection to a Bluetooth Keyboard or Mouse, the HID functionality should work out of the box.
On connection to a Bluetooth Keyboard or Mouse, the HID functionality should work out of the box.
 +
<li> PBAP/OPP <br>
 +
Object push, Vcard listing should also work out of box, since Android provides them
 +
<li> FTP <br>
 +
3rd party applications like BlueFTP are available from Android App Market which should work without modifications upon installation.
== Important Notes ==
== Important Notes ==

Revision as of 12:07, 21 February 2011

Contents

Introduction

Generally used OMAP and Connectivity combinations are OMAP3 and WL127x (as in Zoom2, Zoom3 devices) or OMAP4 and WL128x (as in Blaze devices). However, few customers and internal TI teams need combinations OMAP3 + WL128x and OMAP4 + WL127x. The following hints should help in case you have combination of devices and not making use of the devices on-board.

For on-board devices, i.e Zoom2/3(with WL127x), Blaze(with WL128x) and Panda (with WL127x) - The relevant releases for the board should get Bluetooth, FM work out of the box.

There are multiple WiLink devices that can be supported on multiple OMAP platforms. Below list provides combination of platforms available:

Porting shared transport solution

Shared Transport driver is a line discipline driver, which acts a generic transport for Bluetooth, FM and GPS (in case of WL128x). Each such protocol drivers have a register, unregister mechanism with the shared transport driver and upon registration can do a write concurrently, and shared transport would queue up the data and would send it over UART. Upon receiving protocol specific data, shared transport would interpret the data and forward it to protocol driver via callbacks.

Shared transport driver is also a platform device driver and hence any platform which has a WL127x/WL128x device and wants to make use of this driver, need to have an entry of adding the platform device in their architecture specific board file.

Illustration:-

/* wl128x BT, FM, GPS connectivity chip */
struct ti_st_plat_data wilink_pdata = {
        .nshutdown_gpio = 55,
        .dev_name = "/dev/ttyO1",
        .flow_cntrl = 1,
        .baud_rate = 3000000,
};
static struct platform_device wl128x_device = {
        .name           = "kim",
        .id             = -1,
        .dev.platform_data = &wilink_pdata,
};

and in one of the architecture init functions, perform :- platform_device_register(&wl128x_device);

btwilink driver

BTWILINK driver at drivers/bluetooth/btwilink.c provides the bluetooth driver which makes use of the shared transport driver which talks to the bluetooth core on the WiLink chipsets. Enable this driver either as a module or as a built-in component along with necessary bluetooth functionality in the kernel.

Similar to the TI ST driver, this is also a platform device driver and requires a relevant platform device registration,

static struct platform_device btwilink_device = {
       .name = "btwilink",
       .id = -1,
};

The above platform device along with addition in one of the architecture init functions, would enable the Bluetooth driver for WiLink chipsets.

User Space components

A utility known as UIM is very much required for the shared transport [TI_ST] driver to be working. Most line disciplines if not all require a user-space daemon to be opening the UART and installing the line discipline thereby giving out the control to the line discipline driver.

UIM can be found @ http://git.omapzoom.org/?p=platform/hardware/ti/wpan.git;a=summary The latest can be found at gingerbread branch by name uim-sysfs, http://git.omapzoom.org/?p=platform/hardware/ti/wpan.git;a=tree;f=ti_st/uim-sysfs;h=12ce6bafd461474ad90d41a0b9523a94534e4c0a;hb=refs/heads/gingerbread

UIM needs to be run at boot, Since linux flavors might require Bluetooth or GPS to be turned on at boot. For this have the UIM entry in your either one of your rc.S files or you can have special udev rule based on the platform driver addition of device "kim". For Android, the following entry in init.rc should suffice,

service uim /system/bin/uim-sysfs
    user root
    group media bluetooth
    oneshot

firmware

Bluetooth, FM and GPS all require their own firmware files, with the Bluetooth firmware being required to be downloaded before any of the other cores are made use of in WiLink. https://gforge.ti.com/gf/project/wilink_drivers/ - Should point to the latest firmware files that are released.

Shared Transport driver uses the firmware class sub-system to download firmware and hence the firmware ".bts" files need to exist in /system/etc/firmware/ for Android and /lib/firmware/ for ubuntu.

On boot check

Since there are many versions of the drivers floating around and a lot needs to be done to get them all working fine. A few things below can be checked if the port went well.

Enabling profiles on Android

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox