All of lore.kernel.org
 help / color / mirror / Atom feed
From: pavel@denx.de (Pavel Machek)
To: cip-dev@lists.cip-project.org
Subject: [cip-dev] [PATCH 4.19.y-cip 4/6] rtc: rx8581: Add support for Epson rx8571 RTC
Date: Tue, 16 Jul 2019 22:22:12 +0200	[thread overview]
Message-ID: <20190716202212.GB9557@amd> (raw)
In-Reply-To: <1563200245-30331-5-git-send-email-biju.das@bp.renesas.com>

Hi!

> +static int rx85x1_nvram_read(void *priv, unsigned int offset, void *val,
> +			     size_t bytes)
> +{
> +	struct rx8581 *rx8581 = priv;
> +	unsigned int tmp_val;
> +	int ret;
> +
> +	ret = regmap_read(rx8581->regmap, RX8581_REG_RAM, &tmp_val);
> +	(*(unsigned char *)val) = (unsigned char) tmp_val;
> +
> +	return ret;
> +}
> +
> +static int rx85x1_nvram_write(void *priv, unsigned int offset, void *val,
> +			      size_t bytes)
> +{
> +	struct rx8581 *rx8581 = priv;
> +	unsigned char tmp_val;
> +
> +	tmp_val = *((unsigned char *)val);
> +	return regmap_write(rx8581->regmap, RX8581_REG_RAM,
> +				(unsigned int)tmp_val);
> +}

I see that 85x1 has single byte of RAM. I'd still expect return of
error in case of offset != 0 or bytes != 1.

Probably best done in mainline first...

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20190716/22b19a6e/attachment.sig>

  reply	other threads:[~2019-07-16 20:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 14:17 [cip-dev] [PATCH 4.19.y-cip 0/6] Add RTC support Biju Das
2019-07-15 14:17 ` [cip-dev] [PATCH 4.19.y-cip 1/6] rtc: nvmem: use devm_nvmem_register() Biju Das
2019-07-15 14:17 ` [cip-dev] [PATCH 4.19.y-cip 2/6] rtc: nvmem: remove nvmem from struct rtc_device Biju Das
2019-07-15 14:17 ` [cip-dev] [PATCH 4.19.y-cip 3/6] dt-bindings: rtc: add rx8571 compatible Biju Das
2019-07-15 14:17 ` [cip-dev] [PATCH 4.19.y-cip 4/6] rtc: rx8581: Add support for Epson rx8571 RTC Biju Das
2019-07-16 20:22   ` Pavel Machek [this message]
2019-07-17  6:46     ` Biju Das
2019-07-15 14:17 ` [cip-dev] [PATCH 4.19.y-cip 5/6] arm64: defconfig: enable RX-8581 config option Biju Das
2019-07-15 14:17 ` [cip-dev] [PATCH 4.19.y-cip 6/6] arm64: dts: renesas: r8a774c0-cat874: add RTC support Biju Das
2019-07-16 20:32 ` [cip-dev] [PATCH 4.19.y-cip 0/6] Add " Pavel Machek

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=20190716202212.GB9557@amd \
    --to=pavel@denx.de \
    --cc=cip-dev@lists.cip-project.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.