From patchwork Sat May 30 17:25:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew de Quincey X-Patchwork-Id: 27065 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4UHPISg020549 for ; Sat, 30 May 2009 17:25:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760317AbZE3RZN (ORCPT ); Sat, 30 May 2009 13:25:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760409AbZE3RZN (ORCPT ); Sat, 30 May 2009 13:25:13 -0400 Received: from 82-71-49-12.dsl.in-addr.zen.co.uk ([82.71.49.12]:38402 "EHLO mail.lidskialf.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760317AbZE3RZM (ORCPT ); Sat, 30 May 2009 13:25:12 -0400 Received: from lidskialf.net (beyond.lidskialf.net [172.16.1.1]) by mail.lidskialf.net (Postfix) with ESMTP id 8EA3A4944D5BD; Sat, 30 May 2009 18:25:13 +0100 (BST) Received: from munin.lidskialf.net (munin.lidskialf.net [172.16.1.17]) by lidskialf.net (Horde Framework) with HTTP; Sat, 30 May 2009 18:25:13 +0100 Message-ID: <20090530182513.214244z6d3s8cb9c@lidskialf.net> Date: Sat, 30 May 2009 18:25:13 +0100 From: Andrew de Quincey To: linux-omap@vger.kernel.org Cc: ville.tervo@nokia.com Subject: prepatch: work around broken brf6150 PM code MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.3) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Hi, this patch took a while to track down. The brf6150.c from the original Nokia n770 kernel source (kernel-source-2.6.16-2.6.16-osso29) works. However, the brf6150.c that was added to the linux-omap tree on the 8th feb 2006 (commit 9f43ca7f2eca4de6f145bc1d165df4a415546258) does not (for this n770 anyway :). In the linux-omap commit, there is a lot of new neat power management code that uses two GPIOs: one for the host to signal the brf6150 when to wake up and one for the brf6150 to signal the host to wake up. The problem is that on the hardware I'm using these GPIOs do not change, so the host never "wakes up", and consequently never schedules packets to be transferred to the brf6150. I've tested the platform GPIO library is working properly and appears to be. The n770 code is configured to use the following brf6510 GPIOS: reset:4, hostwake:61, btwake:194. The attached patch forces this schedule, but isn't really a good patch as the (non-functional) PM stuff is still in there. Can anyone shed any light on this situation? Note that I am using the brf6150fw.bin firmware binary from the SU-18_2006SE_1.2006.26-8_PR_F5_MR0_ARM OS release. The bluetooth firmware from SU-18_2006SE_2.2006.39-14_PR_F5_MR0_ARM is corrupt (has loads of zero bytes at the start, which the code reveals is invalid). The bluetooth firmware from SU-18_2006SE_3.2006.49-2_PR_F5_MR0_ARM is ALSO corrupt; this time its been truncated to 8192 bytes so the loader runs off the end. If this can't be resolved, and since I don't have any docs on the brf6150 or newer firmware images, I'd be tempted to simply kill the PM code since its not actually doing anything useful. I'd prefer to get it to work though.... commit 3dd6f369919225473c77db006a60af0d1ca66ce4 Author: Andrew de Quincey Date: Sat May 30 18:04:24 2009 +0100 schedule tx when packet submitted due to non-working power management GPIOs diff --git a/drivers/bluetooth/brf6150.c b/drivers/bluetooth/brf6150.c index 4f0112a..50caa74 100644 --- a/drivers/bluetooth/brf6150.c +++ b/drivers/bluetooth/brf6150.c @@ -187,6 +187,7 @@ static void brf6150_disable_pm_tx(struct brf6150_info *info) } if (gpio_get_value(info->btinfo->host_wakeup_gpio)) tasklet_schedule(&info->tx_task); + tasklet_schedule(&info->tx_task); } static void brf6150_pm_timer(unsigned long data)