Hi,

On Fri, Jul 04, 2014 at 10:46:11AM +0530, Varka Bhadram wrote:
> Hi Alex,
> 
> Recently you used the_  __regmap__  _  support for at86rf230 driver.
> 
yes.

> I want to know about this framework.
> 
ok.

> I have few questions regarding this:
> 
> 1.What is the objective of this framework ?

1. Performance

Normally sequence of setting register values over any bus is:

 1. CPU <--- GET REG ---> DEV

 2. doing some bitmagic (mask & shift) to set register bits

 3. CPU <--- SET REG ---> DEV


With regmap:

You only call 1. step (once) and cache this value, so you have only:

 1. get value from regmap cache

 2. doing some bitmagic (mask & shift) to set register bits

 3. CPU <--- SET REG ---> DEV


This saves us some bus traffic, but registers which can be changed by
the devices can't hold in the regmap cache and need to use the first sequence.

If you have a get request only, then with regmap you don't need the bus,
simple get the value from cache.

2. Debugging

 You have a sysfs entry for the registers to set/get the current
 registers. This is placed in debugfs usually (spi1.0 bus):
 
 /sys/kernel/debug/regmap/spi1.0

 for example you could run:

 cat /sys/kernel/debug/regmap/spi1.0/registers

 to see the current register settings.

> 2. Where can we use it ?

When linux regmap support the bus type like i2c or spi and for register
settings only. You cannot write your PDU frame with regmap, which makes
no sense (possible you can do that I think, but that's not useful).

> 3. I read that this for low speed protocols like SPI and I2C.
>  Whether this is for slaves devices or master devices ?

I don't if I understand this question right, but master have the clock
and make the SET/GET requests to the slave, so the master cached this
values then.

> 4. Register of SPI or I2C controller devices already mapped to
> processor address space. So in controller driver those registers
> are accessed with read and write instructions.
> What is the need of mapping the registers ?
> 

Regmap doesn't means to map the register in the address space, see above.

> 5. Is there any material to get familiar with the framework ?
> 

Usually kernel documentation is the code. :-) But look for other driver
examples.

Normally the kernel documentation is placed under Documentation in the
kernel src tree. But a:

grep -r regmap Documentation/

doens't show anything so there is no documentation or just google it.




btw: we have a ieee802154 documentation there which need a update:

"Documentation/networking/ieee802154.txt"

- Alex

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to