From patchwork Tue May 11 21:07:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emmanuel Gil Peyrot X-Patchwork-Id: 1477302 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4Ffr996NF5z9sWp for ; Wed, 12 May 2021 07:07:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbhEKVIp (ORCPT ); Tue, 11 May 2021 17:08:45 -0400 Received: from 82-65-109-163.subs.proxad.net ([82.65.109.163]:38232 "EHLO luna.linkmauve.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbhEKVIo (ORCPT ); Tue, 11 May 2021 17:08:44 -0400 Received: by luna.linkmauve.fr (Postfix, from userid 1000) id 8F1A4F40638; Tue, 11 May 2021 23:07:30 +0200 (CEST) From: Emmanuel Gil Peyrot To: Arnd Bergmann , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , linux-kernel@vger.kernel.org Cc: Emmanuel Gil Peyrot , =?utf-8?q?Jonathan_Neusch?= =?utf-8?q?=C3=A4fer?= , Rob Herring , Greg Kroah-Hartman , Aswath Govindraju , Vadym Kochan , devicetree@vger.kernel.org Subject: [PATCH v3 0/3] eeprom-93xx46: Add support for Atmel AT93C56 and AT93C66 Date: Tue, 11 May 2021 23:07:23 +0200 Message-Id: <20210511210727.24895-1-linkmauve@linkmauve.fr> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210424212543.13929-1-linkmauve@linkmauve.fr> References: <20210424212543.13929-1-linkmauve@linkmauve.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org These two devices differ from the AT93C46 by their storage size, respectively 2 Kib and 4 Kib, while the AT93C46 contains 1 Kib. The driver was currently hardcoding that addrlen == 7 means 8-bit words, and anything else means 16-bit words. This is obviously not going to work with more storage and thus more bits spent on the address (for instance on the AT93C66 in 8-bit words mode, addrlen == 9 since there are 512 bytes to address), so I’m now doing those checks based on the word size specified in the device tree. It might make sense to rename this driver now that it supports all three sizes, but I don’t know what would be a good name, eeprom_93xxx6 doesn’t sound very nice. I have tested this series on a Nintendo Wii U, on the downstream linux-wiiu kernel based on 4.19, and thus only with a AT93C66. You can find this work here if you want to test it: https://gitlab.com/linux-wiiu/linux-wiiu/-/merge_requests/16 Changes since v1: - Reordered and squashed patches. - Split out the dts addition. - Removed a bogus goto. - Improved commit messages to make what they do more explicit. Changes since v2: - Renamed the dts patch. - Included the R-b and A-b these got. Emmanuel Gil Peyrot (3): misc: eeprom_93xx46: Remove hardcoded bit lengths misc: eeprom_93xx46: Add new 93c56 and 93c66 compatible strings dt-bindings: eeprom-93xx46: Add support for 93C46, 93C56 and 93C66 .../bindings/misc/eeprom-93xx46.txt | 3 + drivers/misc/eeprom/eeprom_93xx46.c | 90 +++++++++++++------ include/linux/eeprom_93xx46.h | 3 + 3 files changed, 69 insertions(+), 27 deletions(-)