[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1344600420.252283.1435091331020.JavaMail.open-xchange@oxbsltgw00.schlund.de>
Date: Tue, 23 Jun 2015 22:28:50 +0200 (CEST)
From: Stefan Wahren <stefan.wahren@...e.com>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-arm-kernel@...ts.infradead.org
Cc: wxt@...k-chips.com, linux-api@...r.kernel.org,
Kumar Gala <galak@...eaurora.org>,
Rob Herring <robh+dt@...nel.org>, sboyd@...eaurora.org,
arnd@...db.de, s.hauer@...gutronix.de,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
mporter@...sulko.com,
Maxime Ripard <maxime.ripard@...e-electrons.com>,
pantelis.antoniou@...sulko.com, devicetree@...r.kernel.org,
Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH v6 3/9] nvmem: Add nvmem_device based consumer apis.
> Srinivas Kandagatla <srinivas.kandagatla@...aro.org> hat am 23. Juni 2015 um
> 01:08 geschrieben:
>
>
> This patch adds read/write apis which are based on nvmem_device. It is
> common that the drivers like omap cape manager or qcom cpr driver to
> access bytes directly at particular offset in the eeprom and not from
> nvmem cell info in DT. These driver would need to get access to the nvmem
> directly, which is what these new APIS provide.
>
> [...]
> diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
> index 123af62..f9acc43 100644
> --- a/include/linux/nvmem-consumer.h
> +++ b/include/linux/nvmem-consumer.h
> @@ -15,6 +15,15 @@
> struct device;
> /* consumer cookie */
> struct nvmem_cell;
> +struct nvmem_device;
> +
> +struct nvmem_cell_info {
> + const char *name;
> + int offset;
> + int bytes;
> + int bit_offset;
> + int nbits;
> +};
>
> #if IS_ENABLED(CONFIG_NVMEM)
>
> @@ -26,6 +35,21 @@ void devm_nvmem_cell_put(struct device *dev, struct
> nvmem_cell *cell);
> void *nvmem_cell_read(struct nvmem_cell *cell, ssize_t *len);
> int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len);
>
> +/* direct nvmem device read/write interface */
> +struct nvmem_device *nvmem_device_get(struct device *dev, const char *name);
> +struct nvmem_device *devm_nvmem_device_get(struct device *dev,
> + const char *name);
> +void nvmem_device_put(struct nvmem_device *nvmem);
> +void devm_nvmem_device_put(struct device *dev, struct nvmem_device *nvmem);
> +int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset,
> + size_t bytes, void *buf);
> +int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset,
> + size_t bytes, void *buf);
Maybe i mixed something but those functions use the datatype unsigned int for
offset
and the offset in the structs use datatype int. Looks a little bit inconsistent.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists