From owner-freebsd-multimedia@FreeBSD.ORG Fri Oct 26 15:27:43 2007 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5573E16A418 for ; Fri, 26 Oct 2007 15:27:43 +0000 (UTC) (envelope-from achill@matrix.gatewaynet.com) Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mx1.freebsd.org (Postfix) with ESMTP id 9B2F013C480 for ; Fri, 26 Oct 2007 15:27:41 +0000 (UTC) (envelope-from achill@matrix.gatewaynet.com) Received: from smadev.internal.net (localhost [127.0.0.1]) by smadev.internal.net (8.13.6/8.13.6) with ESMTP id l9QFRWZT056778; Fri, 26 Oct 2007 18:27:32 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.13.6/8.13.6/Submit) id l9QFRQMj056777; Fri, 26 Oct 2007 18:27:26 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: Mark Tinguely Date: Fri, 26 Oct 2007 18:27:25 +0300 User-Agent: KMail/1.9.3 References: <200710261359.l9QDxFZh088302@casselton.net> In-Reply-To: <200710261359.l9QDxFZh088302@casselton.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200710261827.25933.achill@matrix.gatewaynet.com> Cc: freebsd-multimedia@freebsd.org Subject: Re: bktr and GPIO X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2007 15:27:43 -0000 =CE=A3=CF=84=CE=B9=CF=82 =CE=A0=CE=B1=CF=81=CE=B1=CF=83=CE=BA=CE=B5=CF=85= =CE=AE 26 =CE=9F=CE=BA=CF=84=CF=8E=CE=B2=CF=81=CE=B9=CE=BF=CF=82 2007 16:59= , =CE=BF/=CE=B7 Mark Tinguely =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > (deleted information. He is interested in getting the Zoneminder bktr(8) > based relays to work). > > > I have some contact with the person who manufactures the cards and > > writes the linux drivers, and he asked me if FreeBSD has access to bt878 > > GPIO, and said that it would be easy if so. > > You will need to know what values need to be writen to which register to > enable the particular relay. In the kernel driver source program, add > a new ioctl() so that you can enable this feature from the user program. According to Vassili Leonov of LML, =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D In relation to bits assignments on LMLBT4M and LMLBT44 cards: /* to allow access to GPIO bits for sensors input and alarms output GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | | IN - sensor inputs, INx - sensor inputs and TI XORed together O1,O2,O3 - alarm outputs (relays) GPIO bits should be enabled for outpus as follows: OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 =3D 0x6C0 */ So the words are 11 bits long. > > The command inside the new ioctl() will probably look roughly like: > > #ifdef OPTIONAL_READ_OLD > /* optionally may need to preserve some other settings */ > set =3D (IN#(bktr, BKTR_GPIO_@@@@) & ~mask) | set; > #endif > OUT#(bktr, BKTR_GPIO_@@@@, set); /* turn on relay "value" */ > > where > mask optional turn off bits > set enable bits > # is the size (B)yte, (W)ord, (L)ong > @@@@ is the register location (you probably will have to add a > define for this location into the header file). Is=20 #define BKTR_GPIO_DMA_CTL 0x10C #define BKTR_GPIO_OUT_EN 0x118 #define BKTR_GPIO_REG_INP 0x11C #define BKTR_GPIO_DATA 0x200 in /usr/src/sys/dev/bktr/bktr_reg.h any relevant to the above? What to they represent? Why i was able to call ioctl BT848_GPIO_* on /dev/tuner0 but=20 not /dev/bktr0? A little enlightment would be great! > > --Mark Tinguely =2D-=20 Achilleas Mantzios