From: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
To: matt.ranostay@konsulko.com, mchehab@kernel.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
Subject: [PATCH 2/3] media: i2c: video-i2c: Replace constants with proper names
Date: Tue, 19 Apr 2022 22:20:50 +0200 [thread overview]
Message-ID: <20220419202051.44013-3-mosescb.dev@gmail.com> (raw)
In-Reply-To: <20220419202051.44013-1-mosescb.dev@gmail.com>
Acc to MLX90640 datasheet:
- 0x0400 represents the start of RAM address
- 0x2400 represents the start of EEPROM address
Reference: https://www.melexis.com/-/media/files/documents\
/datasheets/mlx90640-datasheet-melexis.pdf
Signed-off-by: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
---
drivers/media/i2c/video-i2c.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index b3fe9a507f7f..1d5f48329cb2 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -54,6 +54,12 @@
/* Temperature register */
#define AMG88XX_REG_T01L 0x80
+/* RAM */
+#define MLX90640_RAM_START_ADDR 0x0400
+
+/* EEPROM */
+#define MLX90640_EEPROM_START_ADDR 0x2400
+
/* Control register */
#define MLX90640_REG_CTL1 0x800d
#define MLX90640_REG_CTL1_MASK 0x0380
@@ -149,7 +155,7 @@ static int mlx90640_nvram_read(void *priv, unsigned int offset, void *val,
{
struct video_i2c_data *data = priv;
- return regmap_bulk_read(data->regmap, 0x2400 + offset, val, bytes);
+ return regmap_bulk_read(data->regmap, MLX90640_EEPROM_START_ADDR + offset, val, bytes);
}
static struct nvmem_config mlx90640_nvram_config = {
@@ -168,7 +174,7 @@ static int amg88xx_xfer(struct video_i2c_data *data, char *buf)
static int mlx90640_xfer(struct video_i2c_data *data, char *buf)
{
- return regmap_bulk_read(data->regmap, 0x400, buf,
+ return regmap_bulk_read(data->regmap, MLX90640_RAM_START_ADDR, buf,
data->chip->buffer_size);
}
--
2.30.2
next prev parent reply other threads:[~2022-04-19 20:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 20:20 [PATCH 0/3] media: i2c: video-i2c: Minor corrections Moses Christopher Bollavarapu
2022-04-19 20:20 ` [PATCH 1/3] media: i2c: video-i2c: Move defines to the top of the file Moses Christopher Bollavarapu
2022-04-19 20:20 ` Moses Christopher Bollavarapu [this message]
2022-04-19 20:20 ` [PATCH 3/3] media: i2c: video-i2c: Use GENMASK for masking bits Moses Christopher Bollavarapu
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=20220419202051.44013-3-mosescb.dev@gmail.com \
--to=mosescb.dev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=matt.ranostay@konsulko.com \
--cc=mchehab@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.