From patchwork Thu Mar 24 16:19:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 64405 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp756889lbc; Thu, 24 Mar 2016 09:21:09 -0700 (PDT) X-Received: by 10.98.74.200 with SMTP id c69mr14010285pfj.129.1458836466137; Thu, 24 Mar 2016 09:21:06 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s28si13089334pfi.238.2016.03.24.09.21.05; Thu, 24 Mar 2016 09:21:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757575AbcCXQU4 (ORCPT + 1 other); Thu, 24 Mar 2016 12:20:56 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:38040 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754047AbcCXQT5 (ORCPT ); Thu, 24 Mar 2016 12:19:57 -0400 Received: by mail-wm0-f43.google.com with SMTP id l68so73706266wml.1 for ; Thu, 24 Mar 2016 09:19:56 -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=vrAI1GHL3CCWKLohye4qNhvQi7LD6FV75jXI2ASJD/d7UpFXU6+4YIZiv8hMz/dZH5 nt91M4S5Fv3C2KhUvIXNRVpU4GUfoMOEnXTEArDXHBNxT2szwV4xrk1rFC3ltPxDyGsB 7jK6d13EzPxYwDYaqIOqtecwd6zpQrtyZ2m5EdWat9+8FGTeLcpDs1J03cyncVWfxfox NvYhnXybmDiUhkGNY+EUS/i24aPoH+q4Fsunq+SGlCrIsbDm9eSfEf/+IU1wt/Yqyd7b qXld4Fz0XDMUxDXmjbM+ufbsFc4wvHR1yRQaiuaSlfo40WzXA2Md5+jNQaJc6lNQysxU 84jg== 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=iu3UxFcU75OFa4/4iw2ROngZ/Y3eRsrAud5tL440LXh3w8Unc0dvEl/a8XTXuzbTDr l/6mbt3G/PjqK7CGoL1BX9rka45HmxIrBaBncbJO43D8wCegm9mfPsDaqlFW5k2isLh6 gRuTqt4jS2VtaAG3Z239zEbWZ7cKTJAKMma6nczSDKNolU/7c8qOJn2bH1nnVqOHr7AU PWBYVqWS2YmkMkYCvnbilTLqHWnIfpxpZ0p5nPkttNqCXQNeKVVhH+GyLAwNbAE8XW4e G+/q5E37nSEb9egpqn1BZ2G9ghjSun4mAMATpN+NIHGgQD6eZAcraUsNBlljS7nh61YZ waSg== X-Gm-Message-State: AD7BkJJgJ65fxm17GEabnDYD7eWdx1ln7YwkY534qAFNt/NKtv2Wb+f4Q9p+CAPegsVHwkws X-Received: by 10.194.22.68 with SMTP id b4mr10646866wjf.158.1458836396168; Thu, 24 Mar 2016 09:19:56 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id k124sm8370718wmb.11.2016.03.24.09.19.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Mar 2016 09:19:55 -0700 (PDT) From: Bartosz Golaszewski To: Wolfram Sang , linux-i2c , LKML Cc: Andrew Lunn , Bartosz Golaszewski Subject: [PATCH v2 10/13] eeprom: at24: add the at24cs series to the list of supported devices Date: Thu, 24 Mar 2016 17:19:40 +0100 Message-Id: <1458836383-6668-11-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458836383-6668-1-git-send-email-bgolaszewski@baylibre.com> References: <1458836383-6668-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(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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) },