lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 6 Mar 2012 20:36:11 +0530
From:	Ashish Chavan <ashish.chavan@...tcummins.com>
To:	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Query about regmap SPI

Hi,
  I am planning to add SPI support for da7210 codec driver. SPI for this
codec has slightly different format than others. It has 8 bit register
address and 8 bit data. Out of 8 bits of register address, one bit (i.e.
LSB) is used to indicate read or write. Value of 1 at LSB denotes READ
while value of 0 at LSB denotes write operation.

Thus in order for SPI READ to work correctly, the register address need
to be left shifted by one and then ORed with 0x1. In the same way for
SPI WRITE to work correctly, it need to be left shifted by one.

I have gone though the regmap sources and found that ORing can be
achieved by setting correct read_flag_mask. But I couldn't find anything
by which I can tell regmap core to shift the register address before
ORing it with read_flag_mask. Am I missing anything here?

Is there any other way to achieve this using regmap? The only other way
I can think of is providing a wrapper function to read and write in
codec driver and doing the shifting job inside that wrapper.

TIA!


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists