All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Midgley <bmidgley@xmission.com>
To: bluez-users@lists.sourceforge.net
Subject: Re: [Bluez-users] Socket rev. F with 2.6 kernel
Date: Sun, 17 Apr 2005 18:57:25 -0600	[thread overview]
Message-ID: <426305F5.8010506@xmission.com> (raw)
In-Reply-To: <1113776422.16233.83.camel@pegasus>

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

Pavel,

I had the same card and it would not work with 2.6 until I applied this 
patch. (posted to the mailing list about a month ago)

Even then I couldn't get the rev f to do audio stuff though.

Brad

Marcel Holtmann wrote:
> Hi Pavel,
> 
> 
>>I used SOCKET BT CF card with Zaurus SL-C860 with kernel 2.4.18.
>>It works with dtl1_cs kernel driver. Now I have new distribution
>>with kernel 2.6.11. This driver is not listed in menuconfig now.
>>
>>What kernel driver (2.6.11) to use for this card?
>>I found, that file dtl1_cs.c is present in kernel tree.
> 
> 
> it is still the same driver.
> 
> Regards
> 
> Marcel
> 
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users

[-- Attachment #2: patch-serial-16c950 --]
[-- Type: text/plain, Size: 1535 bytes --]

--- 8250.c_2.6.11-org	2005-03-02 08:37:47.000000000 +0100
+++ 8250.c	2005-03-05 15:01:34.000000000 +0100
@@ -1604,7 +1604,7 @@
 	struct uart_8250_port *up = (struct uart_8250_port *)port;
 	unsigned char cval, fcr = 0;
 	unsigned long flags;
-	unsigned int baud, quot;
+	unsigned int baud, quot, max_baud;
 
 	switch (termios->c_cflag & CSIZE) {
 	case CS5:
@@ -1636,9 +1636,29 @@
 	/*
 	 * Ask the core to calculate the divisor for us.
 	 */
-	baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); 
+	max_baud = (up->port.type == PORT_16C950 ? port->uartclk/4 : port->uartclk/16);
+	baud = uart_get_baud_rate(port, termios, old, 0, max_baud); 
 	quot = serial8250_get_divisor(port, baud);
 
+	/* 
+	 * 16C950 supports additional prescaler ratios between 1:16 and 1:4
+	 * thus increasing max baud rate to uartclk/4. The following was taken
+	 * from kernel 2.4 by Mathias Adam <a2@adamis.de> to make the Socket
+	 * Bluetooth CF Card work under 2.6.11.
+	 * (Patch might have other side effects so be careful!)
+	 */
+	if (up->port.type == PORT_16C950) {
+		unsigned int baud_base = port->uartclk/16;
+		if (baud <= port->uartclk/16)
+			serial_icr_write(up, UART_TCR, 0);
+		else if (baud <= port->uartclk/8) {
+			serial_icr_write(up, UART_TCR, 0x8);
+		} else if (baud <= port->uartclk/4) {
+			serial_icr_write(up, UART_TCR, 0x4);
+		} else
+			serial_icr_write(up, UART_TCR, 0);
+	}
+	
 	/*
 	 * Work around a bug in the Oxford Semiconductor 952 rev B
 	 * chip which causes it to seriously miscalculate baud rates

  reply	other threads:[~2005-04-18  0:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17 21:43 [Bluez-users] Socket rev. F with 2.6 kernel Pavel Ruzicka
2005-04-17 22:20 ` Marcel Holtmann
2005-04-18  0:57   ` Brad Midgley [this message]
2005-04-18  2:10     ` Marcel Holtmann
2005-04-18  7:45     ` Pavel Ruzicka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=426305F5.8010506@xmission.com \
    --to=bmidgley@xmission.com \
    --cc=bluez-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.