From patchwork Mon Dec 7 12:15:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 40463 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C6ADAB6EF7 for ; Mon, 7 Dec 2009 23:18:24 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934525AbZLGMRB (ORCPT ); Mon, 7 Dec 2009 07:17:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934481AbZLGMRB (ORCPT ); Mon, 7 Dec 2009 07:17:01 -0500 Received: from aeryn.fluff.org.uk ([87.194.8.8]:48527 "EHLO kira.home.fluff.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934450AbZLGMQ6 (ORCPT ); Mon, 7 Dec 2009 07:16:58 -0500 Received: from ben by kira.home.fluff.org with local (Exim 4.69) (envelope-from ) id 1NHcWE-0004Hu-BD; Mon, 07 Dec 2009 12:16:46 +0000 Message-Id: <20091207121646.260524161@fluff.org.uk> User-Agent: quilt/0.48-1 Date: Mon, 07 Dec 2009 12:15:02 +0000 From: ben@fluff.org.uk To: netdev@vger.kernel.org Cc: linux@simtec.co.uk, doong.ping@micrel.com, tristram.ha@micrel.com, Wolfram Sang , Jean Delvare , Linux Kernel Subject: [patch 1/9] eeprom_93cx6: Add data direction control. References: <20091207121501.819539008@fluff.org.uk> Content-Disposition: inline; filename=93c-eeprom-add-direction.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Some devices need to know if the data is to be output or read, so add a data direction into the eeprom structure to tell the driver whether the data line should be driven. The user in this case is the Micrel KS8851 which has a direction control for the EEPROM data line and thus needs to know whether to drive it (writing) or to tristate it for receiving. Signed-off-by: Ben Dooks Cc: Wolfram Sang Cc: Jean Delvare Cc: Linux Kernel --- drivers/misc/eeprom/eeprom_93cx6.c | 3 +++ include/linux/eeprom_93cx6.h | 2 ++ 2 files changed, 5 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: b/drivers/misc/eeprom/eeprom_93cx6.c =================================================================== --- a/drivers/misc/eeprom/eeprom_93cx6.c 2009-10-06 15:35:38.000000000 +0100 +++ b/drivers/misc/eeprom/eeprom_93cx6.c 2009-10-06 15:51:18.000000000 +0100 @@ -70,6 +70,7 @@ static void eeprom_93cx6_startup(struct eeprom->reg_data_out = 0; eeprom->reg_data_clock = 0; eeprom->reg_chip_select = 1; + eeprom->drive_data = 1; eeprom->register_write(eeprom); /* @@ -108,6 +109,7 @@ static void eeprom_93cx6_write_bits(stru */ eeprom->reg_data_in = 0; eeprom->reg_data_out = 0; + eeprom->drive_data = 1; /* * Start writing all bits. @@ -147,6 +149,7 @@ static void eeprom_93cx6_read_bits(struc */ eeprom->reg_data_in = 0; eeprom->reg_data_out = 0; + eeprom->drive_data = 0; /* * Start reading all bits. Index: b/include/linux/eeprom_93cx6.h =================================================================== --- a/include/linux/eeprom_93cx6.h 2009-10-06 15:35:38.000000000 +0100 +++ b/include/linux/eeprom_93cx6.h 2009-10-06 15:51:18.000000000 +0100 @@ -45,6 +45,7 @@ * @register_write(struct eeprom_93cx6 *eeprom): handler to * write to the eeprom register by using all reg_* fields. * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines + * @drive_data: Set if we're driving the data line. * @reg_data_in: register field to indicate data input * @reg_data_out: register field to indicate data output * @reg_data_clock: register field to set the data clock @@ -61,6 +62,7 @@ struct eeprom_93cx6 { int width; + char drive_data; char reg_data_in; char reg_data_out; char reg_data_clock;