Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2389356pxy; Sat, 24 Apr 2021 14:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMXjLXQu53/nng8ZjYmvyRouq5+wqKDVLrPq/lYwa8B3V6tiTJIXAqtXE2BsvB6SSSWHm7 X-Received: by 2002:a17:902:8202:b029:ec:b398:6d73 with SMTP id x2-20020a1709028202b02900ecb3986d73mr10761635pln.37.1619299593537; Sat, 24 Apr 2021 14:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619299593; cv=none; d=google.com; s=arc-20160816; b=Y5KPzmPzmcy2Wz3n7OZQ+92LxH8mbizjfHItbHidxoF3/p57OHDVhW7DDyQbhJ+QDw 3Nmn/EuuBr/5wXT+mX9E6c2iHiivaAtrxJqQ3KC8fN0Q0IrwC4RWZNIv/j7j+7tac+9P 5St0otfxZPHPexrr4agK4QaPAjrBqdHjeN+SjFnC9LuIeAdccac50yP2I41KbcdEn2bm C7jAsAxZ3t+aMg8DKA0kAGzeZ5Uc6CtTc/CJq9QMM9Q3BlAqOnQ+ImU/BUlfgWPt097/ jnge3PUyxyOMrZgl1TLcDq97yr88ust1TGw9c58TU7IzcqeFhGXwp9BO7ul4jNChQzD3 QuaQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=84iZgNNIgiKNi9mIoiEUe8+m7nc7jhQC3f2QoVMG+fU=; b=HkW2C8AKIXGHz0iH3MbJW0hizWJN2o/QhU3aRbMF3TfQ2ugBV4cZCebFt+oj9MKk4F zdps2qzfDz/oKXMDLOZjEyy1OnpWE1Hb5j8Mo8y7ROEVkPEbjBJN7KUXDdNXwfHrckwG jSHGHP4FB6PCqANv/HL2tu7YgrhskzbB3Bxw4BVyXC8OtLvR34LEwl9PeVHwKK8aAiEm 8zuCwAPjYmxtUZjQICqYGWRIsrQiM0dDRd14NfCR6TAN85XymG7luUG9JoG8kLf+TVqF q5MuTcC2Hb6iQfDD5/jHj9PoPz5l6O9CFVqzqJxpotcsGzyn34ZHMOQJ4CXIZP4f+Uo6 G3aw== 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 95si12332098pla.43.2021.04.24.14.26.21; Sat, 24 Apr 2021 14:26:33 -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 S230430AbhDXV0a (ORCPT + 99 others); Sat, 24 Apr 2021 17:26:30 -0400 Received: from 82-65-109-163.subs.proxad.net ([82.65.109.163]:32848 "EHLO luna.linkmauve.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbhDXV03 (ORCPT ); Sat, 24 Apr 2021 17:26:29 -0400 Received: by luna.linkmauve.fr (Postfix, from userid 1000) id 77F15F4043B; Sat, 24 Apr 2021 23:25:49 +0200 (CEST) From: Emmanuel Gil Peyrot To: Arnd Bergmann , =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , 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 v2 0/3] eeprom-93xx46: Add support for Atmel AT93C56 and AT93C66 Date: Sat, 24 Apr 2021 23:25:40 +0200 Message-Id: <20210424212543.13929-1-linkmauve@linkmauve.fr> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210424123034.11755-1-linkmauve@linkmauve.fr> References: <20210424123034.11755-1-linkmauve@linkmauve.fr> 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 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. Emmanuel Gil Peyrot (3): misc: eeprom_93xx46: Remove hardcoded bit lengths misc: eeprom_93xx46: Add new 93c56 and 93c66 compatible strings dts: 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(-) -- 2.31.1