From: Laxman Dewangan <ldewangan@nvidia.com>
To: Mark Brown <broonie@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Need APIs to add regmap in dev
Date: Thu, 14 Jan 2016 00:27:21 +0530 [thread overview]
Message-ID: <56969E11.7060407@nvidia.com> (raw)
Hi Mark,
when working on unification of Max77620, MAX77686 RTC driver, I came to
need of APIs from regmap to add the device as devres.
int dev_add_regmap(dev, regmap);
This will add the regmap in the dev resource of device. This will help
to get the regmap handle from device using dev_get_regmap(). This APIs
will be different from the regmap_attach_dev() where map->dev is moved
to new device.
The requirement came from multiple i2c slave address device like MAX77620.
MAX77620 has 2 i2c address 0x3C and 0x68. 0x68 is for RTC IP block.
we register device with 0x3C and create dummy i2c client for 0x68 inside
driver.
We create two regmap, one from 0x3C i2c client as rmap_0x3c and other
from 0x68 i2c dummy client rmap_0x68.
Now in RTC driver(mfd device), we have the parent device as dev_0x3c.
When we try to get the regmap handle, we only get one regmap per device
as we register regmap with different devices.
If I had above API then I can add the rmap_0x68 in the dev_0x3c as
dev_res. By this I can have two regmap list on dev_0x3c and get rmap
handle by dev_get_regmap(dev_0x3c, "pmic-slave") and
dev_get_regmap(dev_0x3c, "rtc-slave");
I like to know your comment on this approach to add the regmap on
different device resource.
Thanks,
Laxman
next reply other threads:[~2016-01-13 19:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 18:57 Laxman Dewangan [this message]
2016-01-14 1:08 ` Need APIs to add regmap in dev Krzysztof Kozlowski
2016-01-14 11:47 ` Laxman Dewangan
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=56969E11.7060407@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=broonie@kernel.org \
--cc=k.kozlowski@samsung.com \
--cc=linux-kernel@vger.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.