From patchwork Fri Nov 30 12:39:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Hermant X-Patchwork-Id: 202934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id A61332C0089 for ; Fri, 30 Nov 2012 23:39:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2278B31462; Fri, 30 Nov 2012 12:39:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cL8eaIJGrq3L; Fri, 30 Nov 2012 12:39:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 4595A31495; Fri, 30 Nov 2012 12:39:46 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4DE108F793 for ; Fri, 30 Nov 2012 12:39:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2978389B66 for ; Fri, 30 Nov 2012 12:39:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iBchcmiCkKfq for ; Fri, 30 Nov 2012 12:39:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.162]) by whitealder.osuosl.org (Postfix) with ESMTPS id 27D428A0CD for ; Fri, 30 Nov 2012 12:39:25 +0000 (UTC) X-RZG-AUTH: :K34Bck+6YrEgjuBfzmrkukPJhhbHEm1G+2SCnvvjhur6rsGj/jgixsrTkwdMQP1Z/nY9De0+2x7BiUI2hEo= X-RZG-CLASS-ID: mo00 Received: from ghermant-Q310.home (ALyon-754-1-14-229.w90-53.abo.wanadoo.fr [90.53.249.229]) by smtp.strato.de (jorabe mo50) (RZmta 31.7 DYNA|AUTH) with ESMTPA id z00e05oAUBucmB ; Fri, 30 Nov 2012 13:39:24 +0100 (CET) From: Gregory Hermant To: buildroot@busybox.net Date: Fri, 30 Nov 2012 13:39:15 +0100 Message-Id: <1354279156-20649-6-git-send-email-gregory.hermant@calao-systems.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1354279156-20649-1-git-send-email-gregory.hermant@calao-systems.com> References: <1354279156-20649-1-git-send-email-gregory.hermant@calao-systems.com> Subject: [Buildroot] [PATCH v5 5/6] bluez-utils: add support for the ST-Ericsson cg2900 combo controller X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Gregory Hermant --- ...tils-4.101-enable_cg2900_on_upstream_4.91.patch | 106 ++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 package/bluez_utils/bluez_utils-4.101-enable_cg2900_on_upstream_4.91.patch diff --git a/package/bluez_utils/bluez_utils-4.101-enable_cg2900_on_upstream_4.91.patch b/package/bluez_utils/bluez_utils-4.101-enable_cg2900_on_upstream_4.91.patch new file mode 100644 index 0000000..e80af5f --- /dev/null +++ b/package/bluez_utils/bluez_utils-4.101-enable_cg2900_on_upstream_4.91.patch @@ -0,0 +1,106 @@ +From ac7992081abba87627c9e91735b3309584b48585 Mon Sep 17 00:00:00 2001 +From: Gregory Hermant +Date: Wed, 14 Nov 2012 14:27:02 +0100 +Subject: [PATCH] add support for the ST-Ericsson CG2900 GPS FM Bluetooth + combo controller + + +Signed-off-by: Gregory Hermant +--- + tools/hciattach.c | 22 +++++++++++++++------- + tools/hciattach.h | 1 + + 2 files changed, 16 insertions(+), 7 deletions(-) + +diff --git a/tools/hciattach.c b/tools/hciattach.c +index e4d5aa1..7f08243 100644 +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -1066,6 +1066,11 @@ struct uart_t uart[] = { + { "texasalt", 0x0000, 0x0000, HCI_UART_LL, 115200, 115200, + FLOW_CTL, DISABLE_PM, NULL, texasalt, NULL }, + ++ /* ST-Ericsson CG2900 GPS FM Bluetooth combo controller */ ++ { "cg2900", 0x0000, 0x0000, HCI_UART_STE, 115200, 115200, ++ FLOW_CTL, DISABLE_PM, NULL, NULL }, ++ ++ + /* ST Microelectronics minikits based on STLC2410/STLC2415 */ + { "st", 0x0000, 0x0000, HCI_UART_H4, 57600, 115200, + FLOW_CTL, DISABLE_PM, NULL, st }, +@@ -1157,10 +1162,10 @@ static struct uart_t * get_by_type(char *type) + } + + /* Initialize UART driver */ +-static int init_uart(char *dev, struct uart_t *u, int send_break, int raw) ++static int init_uart(char *dev, struct uart_t *u, int send_break, int raw, int line_disc) + { + struct termios ti; +- int fd, i; ++ int fd; + unsigned long flags = 0; + + if (raw) +@@ -1217,8 +1222,7 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw) + } + + /* Set TTY to N_HCI line discipline */ +- i = N_HCI; +- if (ioctl(fd, TIOCSETD, &i) < 0) { ++ if (ioctl(fd, TIOCSETD, &line_disc) < 0) { + perror("Can't set line discipline"); + return -1; + } +@@ -1243,7 +1247,7 @@ static void usage(void) + { + printf("hciattach - HCI UART driver initialization utility\n"); + printf("Usage:\n"); +- printf("\thciattach [-n] [-p] [-b] [-r] [-t timeout] [-s initial_speed] [speed] [flow|noflow] [bdaddr]\n"); ++ printf("\thciattach [-n] [-p] [-a line_disc_nr] [-b] [-r] [-t timeout] [-s initial_speed] [speed] [flow|noflow] [bdaddr]\n"); + printf("\thciattach -l\n"); + } + +@@ -1252,6 +1256,7 @@ int main(int argc, char *argv[]) + struct uart_t *u = NULL; + int detach, printpid, raw, opt, i, n, ld, err; + int to = 10; ++ int line_disc = N_HCI; + int init_speed = 0; + int send_break = 0; + pid_t pid; +@@ -1264,8 +1269,11 @@ int main(int argc, char *argv[]) + printpid = 0; + raw = 0; + +- while ((opt=getopt(argc, argv, "bnpt:s:lr")) != EOF) { ++ while ((opt=getopt(argc, argv, "bnpt:s:lra:")) != EOF) { + switch(opt) { ++ case 'a': ++ line_disc = atoi(optarg); ++ break; + case 'b': + send_break = 1; + break; +@@ -1381,7 +1389,7 @@ int main(int argc, char *argv[]) + alarm(to); + bcsp_max_retries = to; + +- n = init_uart(dev, u, send_break, raw); ++ n = init_uart(dev, u, send_break, raw, line_disc); + if (n < 0) { + perror("Can't initialize device"); + exit(1); +diff --git a/tools/hciattach.h b/tools/hciattach.h +index fed0d11..09b534d 100644 +--- a/tools/hciattach.h ++++ b/tools/hciattach.h +@@ -39,6 +39,7 @@ + #define HCI_UART_H4DS 3 + #define HCI_UART_LL 4 + #define HCI_UART_ATH3K 5 ++#define HCI_UART_STE 6 + + #define HCI_UART_RAW_DEVICE 0 + +-- +1.7.9.5 +