From owner-svn-src-head@FreeBSD.ORG Sun Jun 23 20:19:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F006BB5; Sun, 23 Jun 2013 20:19:52 +0000 (UTC) (envelope-from thomas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 579421BE7; Sun, 23 Jun 2013 20:19:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5NKJqKo064981; Sun, 23 Jun 2013 20:19:52 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5NKJqOr064979; Sun, 23 Jun 2013 20:19:52 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201306232019.r5NKJqOr064979@svn.freebsd.org> From: Thomas Quinot Date: Sun, 23 Jun 2013 20:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252123 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2013 20:19:52 -0000 Author: thomas Date: Sun Jun 23 20:19:51 2013 New Revision: 252123 URL: http://svnweb.freebsd.org/changeset/base/252123 Log: Fix minor typo in comment Modified: head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/umcs.h Modified: head/sys/dev/usb/serial/uark.c ============================================================================== --- head/sys/dev/usb/serial/uark.c Sun Jun 23 20:19:05 2013 (r252122) +++ head/sys/dev/usb/serial/uark.c Sun Jun 23 20:19:51 2013 (r252123) @@ -92,6 +92,7 @@ struct uark_softc { uint8_t sc_msr; uint8_t sc_lsr; + uint8_t sc_irda; /* Set to 1 for IrDA */ }; /* prototypes */ @@ -173,8 +174,12 @@ MODULE_DEPEND(uark, ucom, 1, 1, 1); MODULE_DEPEND(uark, usb, 1, 1, 1); MODULE_VERSION(uark, 1); +#define UARK_TYPE_SERIAL 0 +#define UARK_TYPE_IRDA 1 + static const STRUCT_USB_HOST_ID uark_devs[] = { - {USB_VPI(USB_VENDOR_ARKMICRO, USB_PRODUCT_ARKMICRO_ARK3116, 0)}, + {USB_VPI(USB_VENDOR_ARKMICRO, USB_PRODUCT_ARKMICRO_ARK3116, UARK_TYPE_SERIAL)}, + {USB_VPI(USB_VENDOR_ARKMICRO2, USB_PRODUCT_ARKMICRO2_ARK3118, UARK_TYPE_IRDA)}, }; static int @@ -207,6 +212,7 @@ uark_attach(device_t dev) ucom_ref(&sc->sc_super_ucom); sc->sc_udev = uaa->device; + sc->sc_irda = (USB_GET_DRIVER_INFO (uaa) == UARK_TYPE_IRDA); iface_index = UARK_IFACE_INDEX; error = usbd_transfer_setup @@ -378,6 +384,15 @@ uark_cfg_param(struct ucom_softc *ucom, uint32_t speed = t->c_ospeed; uint16_t data; + if (!(sc->sc_irda)) { + uark_cfg_write(sc, 0xb, 0); + } else { + uark_cfg_write(sc, 0xb, 1); + uark_cfg_write(sc, 0xc, 0); + uark_cfg_write(sc, 0xd, 0x41); + uark_cfg_write(sc, 0xa, 1); + } + /* * NOTE: When reverse computing the baud rate from the "data" all * allowed baud rates are within 3% of the initial baud rate. @@ -419,6 +434,10 @@ uark_cfg_param(struct ucom_softc *ucom, } uark_cfg_write(sc, 3, 0x00); uark_cfg_write(sc, 3, data); + + uark_cfg_write(sc, 0xe, 0); + if (sc->sc_irda) + uark_cfg_write (sc, 9, 0); } static void Modified: head/sys/dev/usb/serial/umcs.h ============================================================================== --- head/sys/dev/usb/serial/umcs.h Sun Jun 23 20:19:05 2013 (r252122) +++ head/sys/dev/usb/serial/umcs.h Sun Jun 23 20:19:51 2013 (r252123) @@ -596,7 +596,7 @@ #define MCS7840_UART_LSR_RHROVERRUN 0x02 /* Data FIFO/register overflow */ #define MCS7840_UART_LSR_PARITYERR 0x04 /* Parity error */ #define MCS7840_UART_LSR_FRAMEERR 0x10 /* Framing error */ -#define MCS7840_UART_LSR_BREAKERR 0x20 /* BREAK sigmal received */ +#define MCS7840_UART_LSR_BREAKERR 0x20 /* BREAK signal received */ #define MCS7840_UART_LSR_THREMPTY 0x40 /* THR register is empty, * ready for transmit */ #define MCS7840_UART_LSR_HASERR 0x80 /* Has error in receiver FIFO */