From owner-svn-src-head@FreeBSD.ORG Wed Aug 1 11:59:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4DC8106566B; Wed, 1 Aug 2012 11:59:46 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF6F8FC19; Wed, 1 Aug 2012 11:59:46 +0000 (UTC) Received: from terran.dlink.ua (unknown [192.168.10.90]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id 8922BC493C; Wed, 1 Aug 2012 14:59:45 +0300 (EEST) Date: Wed, 1 Aug 2012 14:59:17 +0300 From: Aleksandr Rybalko To: Warner Losh Message-Id: <20120801145917.01cf85f6.ray@dlink.ua> In-Reply-To: <201208010118.q711Ia5p094390@svn.freebsd.org> References: <201208010118.q711Ia5p094390@svn.freebsd.org> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238965 - head/sys/dev/spibus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 01 Aug 2012 11:59:46 -0000 On Wed, 1 Aug 2012 01:18:36 +0000 (UTC) Warner Losh wrote: >> Author: imp >> Date: Wed Aug 1 01:18:36 2012 >> New Revision: 238965 >> URL: http://svn.freebsd.org/changeset/base/238965 >> >> Log: >> Add the chip select glue. >> >> Modified: >> head/sys/dev/spibus/spi.h >> head/sys/dev/spibus/spibus.c >> >> Modified: head/sys/dev/spibus/spi.h >> ============================================================================== >> --- head/sys/dev/spibus/spi.h Wed Aug 1 00:36:12 2012 >> (r238964) +++ head/sys/dev/spibus/spi.h Wed Aug 1 01:18:36 >> 2012 (r238965) @@ -1,6 +1,7 @@ >> /* $FreeBSD$ */ >> >> struct spi_command { >> + int cs; >> void *tx_cmd; >> uint32_t tx_cmd_sz; >> void *rx_cmd; >> @@ -10,3 +11,5 @@ struct spi_command { >> void *rx_data; >> uint32_t rx_data_sz; >> }; >> + >> +#define SPI_CHIP_SELECT_HIGH 0x1 /* >> Chip select high (else low) */ >> >> Modified: head/sys/dev/spibus/spibus.c >> ============================================================================== >> --- head/sys/dev/spibus/spibus.c Wed Aug 1 00:36:12 >> 2012 (r238964) +++ head/sys/dev/spibus/spibus.c Wed >> Aug 1 01:18:36 2012 (r238965) @@ -158,6 +158,9 @@ >> spibus_hinted_child(device_t bus, const static int >> spibus_transfer_impl(device_t dev, device_t child, struct >> spi_command *cmd) { >> + /* Maybe set flags too? spi mode? */ >> + spibus_get_cs(dev, &cmd->cs); >> + >> return (SPIBUS_TRANSFER(device_get_parent(dev), child, >> cmd)); } >> Hi Warner, why don't get cs from IVARs in the SPIBUS_TRANSFER method? In many spi drivers it's done this way. For example in sys/mips/atheros/ar71xx_spi.c. WBW -- Alexandr Rybalko aka Alex RAY