From patchwork Mon Apr 11 18:57:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 65563 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1519152qge; Mon, 11 Apr 2016 11:59:16 -0700 (PDT) X-Received: by 10.66.141.103 with SMTP id rn7mr34744036pab.70.1460401156735; Mon, 11 Apr 2016 11:59:16 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d28si4936279pfb.176.2016.04.11.11.59.16; Mon, 11 Apr 2016 11:59:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755399AbcDKS7I (ORCPT + 29 others); Mon, 11 Apr 2016 14:59:08 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:32861 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755298AbcDKS6B (ORCPT ); Mon, 11 Apr 2016 14:58:01 -0400 Received: by mail-pf0-f173.google.com with SMTP id 184so129326733pff.0 for ; Mon, 11 Apr 2016 11:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=x5284QaX0Oc2pqf+2y0XJi13Iur17ywiYcwY5lxrWuw=; b=Wr4z9cq3UCFrH1Dp0d9GZT9APVpZw21JGcfqY/jB79SEJ3afoaT3qQ6aCaytnVGf6k DHoNBpCLk9a49BrOlDTdZ4321mKGoAaD7DA29jOXcI5CVkL4W/ZUl8Nf8MjbAOhzAzrD sP8tUa3kkU+zpwP7CoZ0YoHrLfAhBN/fdrmKfRU8Xwwuac1DzoKovttA1ciHI/BUjoYq O2+0azj1sw9Nd+WwloQGtKk2ZvB/lv34HkK85Be2n6UKRLCQnGhWOW7+IozsB3HUHd4a TiotiC7MQLDVfSfpDVX8qZNLXreR1H7dlG5ZQh7P94IH0/VJfi8RC03pSAs+oOXL7Blu aDHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x5284QaX0Oc2pqf+2y0XJi13Iur17ywiYcwY5lxrWuw=; b=YVFdDwVluTAod40JQ3/rlidV8sqNMPtJA4WnaWs5o29+hd/IDKF/if2tsjLd1xTIOM 18jHJU2EDichDhvp56yBCP5a1panrPEG6QIJhLMP5+z0m7sQMlZ3782fVUINJrS/QGRj WgslAZlT695QnfFjqxPVybKlxCnNzpq9NxTrlrbICHaX6J3UbaBdOfFnF8Orin4bBlBD D2QC+CqF0ihdzRa/3Xm8fBRwT6MkFyvmJNxEpF1cRrMU/lM/LvpYur8BAISi2zT3M32/ yQSHqQe0/OLg0psg4D0jJlvCFxV9fLmAUYmsvCRFZ/s5OvC+iC59VE5+7wp1hngQKuya TLVQ== X-Gm-Message-State: AD7BkJJIh6hNLnGOXZXAuByOE/VEcJfY7vqKmp79Do1ZKCfnqJXSc62nosihPrYac0z4ZuCi X-Received: by 10.98.87.5 with SMTP id l5mr34483611pfb.7.1460401080747; Mon, 11 Apr 2016 11:58:00 -0700 (PDT) Received: from localhost.localdomain (cpe-172-248-200-249.socal.res.rr.com. [172.248.200.249]) by smtp.gmail.com with ESMTPSA id ke7sm22322404pad.44.2016.04.11.11.57.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Apr 2016 11:58:00 -0700 (PDT) From: Bartosz Golaszewski To: Wolfram Sang , linux-i2c , LKML , srinivas.kandagatla@linaro.org, maxime.ripard@free-electrons.com Cc: Andrew Lunn , Bartosz Golaszewski Subject: [RESEND PATCH v2 10/13] eeprom: at24: add the at24cs series to the list of supported devices Date: Mon, 11 Apr 2016 11:57:26 -0700 Message-Id: <1460401049-25459-11-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1460401049-25459-1-git-send-email-bgolaszewski@baylibre.com> References: <1460401049-25459-1-git-send-email-bgolaszewski@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The infrastructure for reading of the factory-programmed serial number for at24cs EEPROM series is now in place. Add the chips that are actually equipped with the serial number memory area to the list of supported devices. The chips from the at24cs family have two memory areas - a regular read-write block and a read-only area containing the serial number. The latter is visible on a different slave address (the address of the wr memory block + 0x08). In order to access both blocks the user needs to instantiate a regular at24c device for the wr block address and a corresponding at24cs device on the serial number block address. Signed-off-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.7.4 diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index d3e4d66..281dd48 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -115,16 +115,34 @@ static const struct i2c_device_id at24_ids[] = { { "24c00", AT24_DEVICE_MAGIC(128 / 8, AT24_FLAG_TAKE8ADDR) }, /* old variants can't be handled with this generic entry! */ { "24c01", AT24_DEVICE_MAGIC(1024 / 8, 0) }, + { "24cs01", AT24_DEVICE_MAGIC(128 / 8, + AT24_FLAG_SERIAL | AT24_FLAG_READONLY) }, { "24c02", AT24_DEVICE_MAGIC(2048 / 8, 0) }, + { "24cs02", AT24_DEVICE_MAGIC(128 / 8, + AT24_FLAG_SERIAL | AT24_FLAG_READONLY) }, /* spd is a 24c02 in memory DIMMs */ { "spd", AT24_DEVICE_MAGIC(2048 / 8, AT24_FLAG_READONLY | AT24_FLAG_IRUGO) }, { "24c04", AT24_DEVICE_MAGIC(4096 / 8, 0) }, + { "24cs04", AT24_DEVICE_MAGIC(128 / 8, + AT24_FLAG_SERIAL | AT24_FLAG_READONLY) }, /* 24rf08 quirk is handled at i2c-core */ { "24c08", AT24_DEVICE_MAGIC(8192 / 8, 0) }, + { "24cs08", AT24_DEVICE_MAGIC(128 / 8, + AT24_FLAG_SERIAL | AT24_FLAG_READONLY) }, { "24c16", AT24_DEVICE_MAGIC(16384 / 8, 0) }, + { "24cs16", AT24_DEVICE_MAGIC(128 / 8, + AT24_FLAG_SERIAL | AT24_FLAG_READONLY) }, { "24c32", AT24_DEVICE_MAGIC(32768 / 8, AT24_FLAG_ADDR16) }, + { "24cs32", AT24_DEVICE_MAGIC(128 / 8, + AT24_FLAG_ADDR16 | + AT24_FLAG_SERIAL | + AT24_FLAG_READONLY) }, { "24c64", AT24_DEVICE_MAGIC(65536 / 8, AT24_FLAG_ADDR16) }, + { "24cs64", AT24_DEVICE_MAGIC(128 / 8, + AT24_FLAG_ADDR16 | + AT24_FLAG_SERIAL | + AT24_FLAG_READONLY) }, { "24c128", AT24_DEVICE_MAGIC(131072 / 8, AT24_FLAG_ADDR16) }, { "24c256", AT24_DEVICE_MAGIC(262144 / 8, AT24_FLAG_ADDR16) }, { "24c512", AT24_DEVICE_MAGIC(524288 / 8, AT24_FLAG_ADDR16) },