Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2113096pxy; Sat, 24 Apr 2021 05:39:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqgFeBhfGtbbpXJV1FsQ85Gims2lA9NHVB/ZxMQSpVFu9D4THZR7MVKDhHv9CAIX62qoAK X-Received: by 2002:a17:906:2287:: with SMTP id p7mr2222997eja.377.1619267943275; Sat, 24 Apr 2021 05:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619267943; cv=none; d=google.com; s=arc-20160816; b=zKhcoBAWtXhHoaniRFL+D0SSCU52jX4LnyjUbCR1kxErtYGfKLqlDhP6twMJkQ/WIB +r22V6ME6DcUxmrVd9XOoq3bdhpJy2roZrQitB3Z3q2G74+jubqTda/Euei60sRiMppL rq+0nCYLcuyHRdmqx8sesXvfH6EGESgnhSRZMLZtFG3HcKwdKpWg8LDZRtmo/nj2vHpE 0hh/DfJpht2rZHH7Y9PaRI1FE2c8NBpcdjQHYKrU/SUWszXo86BEFDYWyoEwt7lrAggM D0FZCitmM5Vz07eqtSQF3OLSt4NaZj2fm1dX+nWAd7Qj165wWp9ohEEhWhLPGQxyDiGZ vo3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=NTknP7YmjpeQq4znDWjrCoVzc+YQ+hvwA0+Hlsb8kQo=; b=Cff0wBBz5PNoQshBALn9z1ykqV4UUZf2VAtVi9fvMc2tX+C8Ek0Ib6SIKkigTJjtbs 3SQW6iIUHT95xkD4TvKtP2QzcoPAJn6bCpSNH37hhEG3D5P7I+dc4FskEBRJ62S0kgIa 818O2I4Uk4vQ8r9mgGmkaFEnEGUfrq6Z9lHZn58Ia/Ud8PHOhFocezCnEymPstBEM1ZJ NvV5+ic5wwRMWH9NtbHMBu6xSu3nGB1iO9qCwNC4Mk5g9dcO0ayeAYa8si7QU3Z8+Vmv KZrK4uEkbzBOH6oEcbpuZWpDXgZPlr7lSw6G0MhCncdz6lC/DBaCbXcrrk1NuXJlHrGn 7mYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb18si7680349ejc.100.2021.04.24.05.38.36; Sat, 24 Apr 2021 05:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237308AbhDXMiT (ORCPT + 99 others); Sat, 24 Apr 2021 08:38:19 -0400 Received: from 82-65-109-163.subs.proxad.net ([82.65.109.163]:55062 "EHLO luna.linkmauve.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233128AbhDXMiO (ORCPT ); Sat, 24 Apr 2021 08:38:14 -0400 Received: by luna.linkmauve.fr (Postfix, from userid 1000) id AE45CF4045D; Sat, 24 Apr 2021 14:30:48 +0200 (CEST) From: Emmanuel Gil Peyrot To: Arnd Bergmann , linux-kernel@vger.kernel.org Cc: Emmanuel Gil Peyrot , =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Rob Herring , Greg Kroah-Hartman , Aswath Govindraju , Vadym Kochan , devicetree@vger.kernel.org Subject: [PATCH 0/4] eeprom-93xx46: Add support for Atmel AT93C56 and AT93C66 Date: Sat, 24 Apr 2021 14:30:29 +0200 Message-Id: <20210424123034.11755-1-linkmauve@linkmauve.fr> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Emmanuel Gil Peyrot (4): misc: eeprom_93xx46: Add new at93c56 and at93c66 compatible strings misc: eeprom_93xx46: set size and addrlen according to the dts misc: eeprom_93xx46: Compute bits based on addrlen misc: eeprom_93xx46: Switch based on word size, not addrlen .../bindings/misc/eeprom-93xx46.txt | 3 + drivers/misc/eeprom/eeprom_93xx46.c | 85 ++++++++++++++----- include/linux/eeprom_93xx46.h | 3 + 3 files changed, 68 insertions(+), 23 deletions(-) -- 2.31.1