* using the same regmap by multiple device drivers
@ 2016-06-29 17:19 Vitaly Andrianov
2016-06-29 18:31 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Vitaly Andrianov @ 2016-06-29 17:19 UTC (permalink / raw)
To: Mark Brown, Lee Jones, Arnd Bergmann, linux-kernel
Hello,
I'm working on two drivers "crypto" and "hwrng", which use the same
hardware module and the same block of registers. Actually the drivers
don't need to access the same registers except several common ones.
Here is fragment of dts.
sa_subsys: subsys@1234000 {
compatible = "syscon";
reg = <0x1234000 0x1000>;
};
crypto@1234000 {
compatible = "ti,netcp-sa-crypto";
syscon-subsys = <&sa_subsys>;
clocks = <&clksa>;
.....
};
rng@1234000 {
compatible = "ti,keystone-rng";
syscon-subsys = <&sa_subsys>;
clocks = <&clksa>;
};
The both drivers use
regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
"syscon-subsys");
to get pointers to "struct regmap".
Unfortunately I can get the first driver working only. When the second
driver tries to call regmap_read() kernel gives "Division by zero in
kernel" error.
Here is my question. Is that actually possible to use in regmap
framework the same registers in multiple different drivers?
Thank you,
-Vitaly
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: using the same regmap by multiple device drivers
2016-06-29 17:19 using the same regmap by multiple device drivers Vitaly Andrianov
@ 2016-06-29 18:31 ` Mark Brown
2016-06-29 18:37 ` Vitaly Andrianov
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2016-06-29 18:31 UTC (permalink / raw)
To: Vitaly Andrianov; +Cc: Lee Jones, Arnd Bergmann, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
On Wed, Jun 29, 2016 at 01:19:37PM -0400, Vitaly Andrianov wrote:
> Here is my question. Is that actually possible to use in regmap framework
> the same registers in multiple different drivers?
Of course, this is how the vast majority of MFDs work. The regmap has
no idea what's calling it, it can't tell if a call comes from one driver
or another.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: using the same regmap by multiple device drivers
2016-06-29 18:31 ` Mark Brown
@ 2016-06-29 18:37 ` Vitaly Andrianov
0 siblings, 0 replies; 3+ messages in thread
From: Vitaly Andrianov @ 2016-06-29 18:37 UTC (permalink / raw)
To: Mark Brown; +Cc: Lee Jones, Arnd Bergmann, linux-kernel
On 06/29/2016 02:31 PM, Mark Brown wrote:
> On Wed, Jun 29, 2016 at 01:19:37PM -0400, Vitaly Andrianov wrote:
>
>> Here is my question. Is that actually possible to use in regmap framework
>> the same registers in multiple different drivers?
>
> Of course, this is how the vast majority of MFDs work. The regmap has
> no idea what's calling it, it can't tell if a call comes from one driver
> or another.
>
Thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-29 18:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-29 17:19 using the same regmap by multiple device drivers Vitaly Andrianov
2016-06-29 18:31 ` Mark Brown
2016-06-29 18:37 ` Vitaly Andrianov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).