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: 609030 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qkK9r0yHtz9sf6 for ; Tue, 12 Apr 2016 04:59:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b=Wr4z9cq3; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752419AbcDKS7H (ORCPT ); Mon, 11 Apr 2016 14:59:07 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:36769 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755289AbcDKS6B (ORCPT ); Mon, 11 Apr 2016 14:58:01 -0400 Received: by mail-pf0-f169.google.com with SMTP id e128so128994153pfe.3 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=F4v2/iIKHxqvwbjAwQWxHue/VlcEa+CB61xGfXxygd4FOM99MaCWsqnnrRW9lLUsiJ amIUUFG8rSGwoEI8+Lw1DHYd08zNjanSAsFvFfDmTRnjUa9dMrddUpNULKY6mSbZLa/L XKwlSk8zOfCdjQwu/teni+0o+mUSI74j/VwG5rbET6zb3kpS0Bo/bRhqKUJyWRJLpMJk Rie10LJM8RLD88sP8wYOga95PNUq9PgecR0+RvY57L4TBWl97he4wpqjYRX8ebQAlPuV rlxKEvogbSNpomKGVv5f58OuEb5u5QnK9YaU3zCiCaPfkWLeP3sEE6kc5yzeu82ZcOs9 uNKg== X-Gm-Message-State: AD7BkJJ4p8Ox4GUTfJ+IJHfKPu0lWL6bUoZdzsUaaDZ0jHTV1YhasAPXt/IE7Am/0Qg1U82z 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-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@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(+) 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) },