All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: regmap: how to support devices with 'nested' pages
Date: Tue, 10 Mar 2015 11:33:24 +0200	[thread overview]
Message-ID: <54FEBA64.3020102@ti.com> (raw)

Hi Mark,

I got a device which registers are arranged in 'books' and pages:

book0
 page0
 page1
 ...
 page127
book1
 page0
 page1
 ...
 page127
...
book255
 page0
 page1
 ...
 page127

The pages can be selected via register0 of each page (in a standard way),
however the book switching can only be done via each book's page0's reg127.

With regmap's ranges I can get the pages covered, but with that I can only
stay within one book.

At power on the chip is at book0, page0.
If I want to access book0, page2:
write 2 to reg0 // to switch to page2
access to the desired register in book0, page2

Now if I want to access let's say book3, page4:
write 0 to reg0 // to switch to page0 of book0
write 3 to reg127 // to switch to book3
write 4 to reg0 // to switch to page4 of book3
access to the desired register

Do you know any other device which have similar addressing? Do you have advice
on how to handle this? Should I open code the book switching in the driver,
which means that I should not use the cache at all in regmap.

Thank you,
Péter

             reply	other threads:[~2015-03-10  9:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10  9:33 Peter Ujfalusi [this message]
2015-03-10 10:25 ` regmap: how to support devices with 'nested' pages Mark Brown

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=54FEBA64.3020102@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=broonie@kernel.org \
    --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.