Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933084AbbFWU3i (ORCPT ); Tue, 23 Jun 2015 16:29:38 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:55282 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932747AbbFWU3a (ORCPT ); Tue, 23 Jun 2015 16:29:30 -0400 Date: Tue, 23 Jun 2015 22:28:50 +0200 (CEST) From: Stefan Wahren Reply-To: Stefan Wahren To: Srinivas Kandagatla , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org Cc: wxt@rock-chips.com, linux-api@vger.kernel.org, Kumar Gala , Rob Herring , sboyd@codeaurora.org, arnd@arndb.de, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, mporter@konsulko.com, Maxime Ripard , pantelis.antoniou@konsulko.com, devicetree@vger.kernel.org, Mark Brown Message-ID: <1344600420.252283.1435091331020.JavaMail.open-xchange@oxbsltgw00.schlund.de> In-Reply-To: <1435014527-26265-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1435014459-26138-1-git-send-email-srinivas.kandagatla@linaro.org> <1435014527-26265-1-git-send-email-srinivas.kandagatla@linaro.org> Subject: Re: [PATCH v6 3/9] nvmem: Add nvmem_device based consumer apis. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.6.2-Rev18 X-Originating-Client: com.openexchange.ox.gui.dhtml X-Provags-ID: V03:K0:ctKFmpKLXlZyCfGW8RdbUMK+bbpbCG6lIX+3KMmmZdsb9K8J2oI L14JKQvDNqOLeqYY8epIWsbruHjjSJ/DUmkDjcYlRHaEyy2/aksxoTQ1uYO9MN2mMNDoLky imdC+DZquoahHKRW+SMg4SJak4ezlXITcX1TjRPWmX+hmjJKKPU4kG5UbuUXaDX2eI82vYb UCGGyWJknXphTPv8SfdNg== X-UI-Out-Filterresults: notjunk:1;V01:K0:j+0YZ+9BFDM=:YDUOjBRD+QEbLPA7a/mtCN ovnjnXuiEg2sutUddj84OpNExqSMgL6PwM/DpGA1+kdKpsT6S7T2hiL0bcdsR+Td0bgGDWcs0 Q0vOtLiHxGY5rFPDDNiUjxKdiWDgY2sXFYoHSa9hXELf0GKDqLmY8LHg89trvbm0iywfCe0Ta z1aC0t2Qpl9GuU0kXGAFblUZaYTLWs3OY23cS+nDn6Nx81g65cX4emQHMW/GAjaHP+bSkGVsv jm14drZaprovfsGD1lhdrLDYUihnxWI6dBrVZFx2KwR7ydBKymFItCo73EUX/t1cR9DK18bis NFTy4wvjrsb142o8HjRnYhoHmIK7ajEm8nFRfruHfET77bPKJWuWLlLMIyQti9S0pUNmcDQAA 7qC9vEjDoA/C/oI/IW9vzWLCIUwXhCgwLye4hnGtRQ81A1vGiJyrhTT0WO40A8/8svp2xUr7P 9eEpiKd1kQt45wZXafKOra4yvfZYWWV0lymFCUPRcXbCTtIM0Yik9ZgFg338orze7uq4eyRhy iqBgRNC8YkashHwZc35Q1XhPUm5e7KB5Pmmk3B8d0cKkUeJ6TtH5f+SRUGgyjhhekPJWu3Euz bVc6moKSAMWONr/Rg46DfaH82CkczupeBC8NenzHyUN46iWWV35b85eGIHJrbWoPkOLmxF43s QQXYkuyCsha4dK7YcZJa3G3fcaj41oGqPOhr/5DwZamrANA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2120 Lines: 56 > Srinivas Kandagatla 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/