From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753059AbcGUAnL (ORCPT ); Wed, 20 Jul 2016 20:43:11 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:46746 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337AbcGUAnJ (ORCPT ); Wed, 20 Jul 2016 20:43:09 -0400 Date: Thu, 21 Jul 2016 02:43:07 +0200 From: Andrew Lunn To: Vivien Didelot Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli Subject: Re: [PATCH net-next v2 2/3] net: dsa: mv88e6xxx: rework EEPROM access Message-ID: <20160721004307.GD22834@lunn.ch> References: <20160720221836.28218-1-vivien.didelot@savoirfairelinux.com> <20160720221836.28218-3-vivien.didelot@savoirfairelinux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160720221836.28218-3-vivien.didelot@savoirfairelinux.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 20, 2016 at 06:18:35PM -0400, Vivien Didelot wrote: > The 6352 family of switches and compatibles provide a 8-bit address and > 16-bit data access to an optional EEPROM. > > Newer chip such as the 6390 family slightly changed the access to 16-bit > address and 8-bit data. > > This commit cleans up the EEPROM access code for 16-bit access and makes > it easy to eventually introduce future support for 8-bit access. > > Here's a list of notable changes brought by this patch: > > - provide Global2 unlocked helpers for EEPROM commands > - remove eeprom_mutex, only reg_lock is necessary for driver functions > - eeprom_len is 0 for chip without EEPROM, so return it directly > - the Running bit must be 0 before r/w, so wait for Busy *and* Running > - remove now unused mv88e6xxx_wait and mv88e6xxx_reg_write > - other than that, the logic (in _{get,set}_eeprom16) didn't change > > Chips with an 8-bit EEPROM access will require to implement the > 8-suffixed variant of G2 helpers and the related flag: > > #define MV88E6XXX_FLAGS_EEPROM8 \ > (MV88E6XXX_FLAG_G2_EEPROM_CMD | \ > MV88E6XXX_FLAG_G2_EEPROM_ADDR) > > Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn Andrew