linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: divagar.mohandass@intel.com
To: robh+dt@kernel.org, mark.rutland@arm.com, wsa@the-dreams.de,
	devicetree@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: rajmohan.mani@intel.com, Divagar Mohandass <divagar.mohandass@intel.com>
Subject: [PATCH 2/3] eeprom: at24: add support to fetch device property "size"
Date: Thu, 27 Jul 2017 22:13:08 +0530	[thread overview]
Message-ID: <1501173789-25959-3-git-send-email-divagar.mohandass@intel.com> (raw)
In-Reply-To: <1501173789-25959-1-git-send-email-divagar.mohandass@intel.com>

From: Divagar Mohandass <divagar.mohandass@intel.com>

This adds support to fetch device property "size" from _DSD.

There is a CAT24C16/GT24C16S NVMEM chip part of the OV13858
camera module and it is connected to i2c bus on Intel KBL board.
This device will use the existing ACPI ID INT3499 and platform
fw will expose "read-only", "pagesize" and "size" props via _DSD.

Signed-off-by: Divagar Mohandass <divagar.mohandass@intel.com>
---
 drivers/misc/eeprom/at24.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 764ff5df..2199c42 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -570,6 +570,10 @@ static void at24_get_pdata(struct device *dev, struct at24_platform_data *chip)
 	if (device_property_present(dev, "read-only"))
 		chip->flags |= AT24_FLAG_READONLY;
 
+	err = device_property_read_u32(dev, "size", &val);
+	if (!err)
+		chip->byte_len = val;
+
 	err = device_property_read_u32(dev, "pagesize", &val);
 	if (!err) {
 		chip->page_size = val;
-- 
1.9.1

  parent reply	other threads:[~2017-07-27 16:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 16:43 [PATCH 0/3] enable new "size" property and runtime pm divagar.mohandass
2017-07-27 16:43 ` [PATCH 1/3] dt-bindings: add "size" property divagar.mohandass
2017-08-03 20:27   ` Rob Herring
2017-08-07  9:08     ` Mohandass, Divagar
2017-09-04  8:57       ` Wolfram Sang
2017-09-04 10:46         ` Mohandass, Divagar
2017-07-27 16:43 ` divagar.mohandass [this message]
2017-07-27 16:43 ` [PATCH 3/3] eeprom: at24: enable runtime pm support divagar.mohandass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1501173789-25959-3-git-send-email-divagar.mohandass@intel.com \
    --to=divagar.mohandass@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rajmohan.mani@intel.com \
    --cc=robh+dt@kernel.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).