<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/regmap, branch v6.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-08-18T14:02:05Z</updated>
<entry>
<title>regmap: spi: Reserve space for register address/padding</title>
<updated>2022-08-18T14:02:05Z</updated>
<author>
<name>Cristian Ciocaltea</name>
<email>cristian.ciocaltea@collabora.com</email>
</author>
<published>2022-08-18T10:48:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5723cfc01932c7a8d5c78dbf7e067e537c91439'/>
<id>urn:sha1:f5723cfc01932c7a8d5c78dbf7e067e537c91439</id>
<content type='text'>
Currently the max_raw_read and max_raw_write limits in regmap_spi struct
do not take into account the additional size of the transmitted register
address and padding.  This may result in exceeding the maximum permitted
SPI message size, which could cause undefined behaviour, e.g. data
corruption.

Fix regmap_get_spi_bus() to properly adjust the above mentioned limits
by reserving space for the register address/padding as set in the regmap
configuration.

Fixes: f231ff38b7b2 ("regmap: spi: Set regmap max raw r/w from max_transfer_size")

Signed-off-by: Cristian Ciocaltea &lt;cristian.ciocaltea@collabora.com&gt;
Reviewed-by: Lucas Tanure &lt;tanureal@opensource.cirrus.com&gt;
Link: https://lore.kernel.org/r/20220818104851.429479-1-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: permit to set reg_update_bits with bulk implementation</title>
<updated>2022-07-18T12:45:28Z</updated>
<author>
<name>Christian Marangi</name>
<email>ansuelsmth@gmail.com</email>
</author>
<published>2022-07-15T20:10:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=739f872e48d47c97fa17a86a7b3356771b75240c'/>
<id>urn:sha1:739f872e48d47c97fa17a86a7b3356771b75240c</id>
<content type='text'>
A regmap may still require to set a custom reg_update_bits instead of
relying to the regmap_bus_read/write general function.

Permit to set it in the map if provided by the regmap config.

Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
Link: https://lore.kernel.org/r/20220715201032.19507-1-ansuelsmth@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: add WARN_ONCE when invalid mask is provided to regmap_field_init()</title>
<updated>2022-07-08T10:51:56Z</updated>
<author>
<name>Matt Ranostay</name>
<email>mranostay@ti.com</email>
</author>
<published>2022-07-08T01:31:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf39ed2e8ecddbee38e02691d6293b812e98e397'/>
<id>urn:sha1:cf39ed2e8ecddbee38e02691d6293b812e98e397</id>
<content type='text'>
In regmap_field_init() when a invalid mask is provided it still
initializes with any warnings.

An example of this is when the LSB is greater than MSB a mask of zero
is produced.

WARN_ONCE() is not ideal for this but requires less changes to core regmap
code.

Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Matt Ranostay &lt;mranostay@ti.com&gt;
Link: https://lore.kernel.org/r/20220708013125.313892-1-mranostay@ti.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap-irq: Fix bug in regmap_irq_get_irq_reg_linear()</title>
<updated>2022-07-05T12:00:55Z</updated>
<author>
<name>Aidan MacDonald</name>
<email>aidanmacdonald.0x0@gmail.com</email>
</author>
<published>2022-07-04T11:28:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=773d09b4c3acafd35f8b6e90848a39cedc03c52b'/>
<id>urn:sha1:773d09b4c3acafd35f8b6e90848a39cedc03c52b</id>
<content type='text'>
irq_reg_stride in struct regmap_irq_chip is often 0, but that
actually means to use the default stride of 1. The effective
stride is stored in struct regmap_irq_chip_data-&gt;irq_reg_stride
and will get the corrected default value.

The default -&gt;get_irq_reg() callback was using the stride from
the chip definition, which is wrong; fix it to use the effective
stride from the chip data instead.

Link: https://lore.kernel.org/lkml/acaaf77f-3282-8544-dd3c-7915fc1a6a4f@samsung.com/
Signed-off-by: Aidan MacDonald &lt;aidanmacdonald.0x0@gmail.com&gt;
Link: https://lore.kernel.org/r/20220704112847.23844-1-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap-irq cleanups and refactoring</title>
<updated>2022-06-30T17:26:37Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2022-06-30T17:26:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e129e413814720fe3ad3cdc74cfc32245cdbe972'/>
<id>urn:sha1:e129e413814720fe3ad3cdc74cfc32245cdbe972</id>
<content type='text'>
Merge series from Aidan MacDonald &lt;aidanmacdonald.0x0@gmail.com&gt;:

This series is an attempt at cleaning up the regmap-irq API in order
to simplify things and consolidate existing features, while at the
same time generalizing it to support a wider range of hardware.

There is a new system for IRQ type configuration, some tweaks to
unmask registers so they're more intuitive and useful, and a new
callback for calculating register addresses. There's also a few
minor code cleanups in here.

In v2 I've taken the approach of adding new features and deprecating
existing ones rather than removing them aggressively. Warnings will
be issued for any drivers that use deprecated features, but they'll
otherwise continue to function normally.

One important caveat: not all of these changes are tested beyond
compile testing, since I don't have hardware to exercise all of
the features.
</content>
</entry>
<entry>
<title>regmap: cache: Add extra parameter check in regcache_init</title>
<updated>2022-06-30T12:33:21Z</updated>
<author>
<name>Schspa Shi</name>
<email>schspa@gmail.com</email>
</author>
<published>2022-06-29T13:09:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a5201d42e2f8a8e8062103170027840ee372742f'/>
<id>urn:sha1:a5201d42e2f8a8e8062103170027840ee372742f</id>
<content type='text'>
When num_reg_defaults &gt; 0 but reg_defaults is NULL, there will be a
NULL pointer exception.

Current code has no such usage, but as additional hardening, also
check this to prevent any chance of crashing.

Signed-off-by: Schspa Shi &lt;schspa@gmail.com&gt;
Link: https://lore.kernel.org/r/20220629130951.63040-1-schspa@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap-irq: Deprecate the not_fixed_stride flag</title>
<updated>2022-06-29T17:13:17Z</updated>
<author>
<name>Aidan MacDonald</name>
<email>aidanmacdonald.0x0@gmail.com</email>
</author>
<published>2022-06-23T21:14:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48e014ee9a61e8f4700987b82f7cb1dc3c89fa76'/>
<id>urn:sha1:48e014ee9a61e8f4700987b82f7cb1dc3c89fa76</id>
<content type='text'>
This flag is a bit of a hack and the same thing can be accomplished
using a custom -&gt;get_irq_reg() callback. Add a warning to catch any
use of the flag.

Signed-off-by: Aidan MacDonald &lt;aidanmacdonald.0x0@gmail.com&gt;
Link: https://lore.kernel.org/r/20220623211420.918875-13-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap-irq: Add get_irq_reg() callback</title>
<updated>2022-06-29T17:13:16Z</updated>
<author>
<name>Aidan MacDonald</name>
<email>aidanmacdonald.0x0@gmail.com</email>
</author>
<published>2022-06-23T21:14:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bdf9b86cd3adbbcf590ab82b74ab8554534c9b6e'/>
<id>urn:sha1:bdf9b86cd3adbbcf590ab82b74ab8554534c9b6e</id>
<content type='text'>
Replace the internal sub_irq_reg() function with a public callback
that drivers can use when they have more complex register layouts.
The default implementation is regmap_irq_get_irq_reg_linear(), used
if the chip doesn't provide its own callback.

Signed-off-by: Aidan MacDonald &lt;aidanmacdonald.0x0@gmail.com&gt;
Link: https://lore.kernel.org/r/20220623211420.918875-12-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap-irq: Fix inverted handling of unmask registers</title>
<updated>2022-06-29T17:13:15Z</updated>
<author>
<name>Aidan MacDonald</name>
<email>aidanmacdonald.0x0@gmail.com</email>
</author>
<published>2022-06-23T21:14:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e8ffb12e7f065db616a3eba79ff138bececf0825'/>
<id>urn:sha1:e8ffb12e7f065db616a3eba79ff138bececf0825</id>
<content type='text'>
To me "unmask" suggests that we write 1s to the register when
an interrupt is enabled. This also makes sense because it's the
opposite of what the "mask" register does (write 1s to disable
an interrupt).

But regmap-irq does the opposite: for a disabled interrupt, it
writes 1s to "unmask" and 0s to "mask". This is surprising and
deviates from the usual way mask registers are handled.

Additionally, mask_invert didn't interact with unmask registers
properly -- it caused them to be ignored entirely.

Fix this by making mask and unmask registers orthogonal, using
the following behavior:

* Mask registers are written with 1s for disabled interrupts.
* Unmask registers are written with 1s for enabled interrupts.

This behavior supports both normal or inverted mask registers
and separate set/clear registers via different combinations of
mask_base/unmask_base.

The old unmask register behavior is deprecated. Drivers need to
opt-in to the new behavior by setting mask_unmask_non_inverted.
Warnings are issued if the driver relies on deprecated behavior.
Chips that only set one of mask_base/unmask_base don't have to
use the mask_unmask_non_inverted flag because that use case was
previously not supported.

The mask_invert flag is also deprecated in favor of describing
inverted mask registers as unmask registers.

Signed-off-by: Aidan MacDonald &lt;aidanmacdonald.0x0@gmail.com&gt;
Link: https://lore.kernel.org/r/20220623211420.918875-11-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap-irq: Deprecate type registers and virtual registers</title>
<updated>2022-06-29T17:13:14Z</updated>
<author>
<name>Aidan MacDonald</name>
<email>aidanmacdonald.0x0@gmail.com</email>
</author>
<published>2022-06-23T21:14:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9edd4f5aee8470dcfd0db04005908f61fbfae8e0'/>
<id>urn:sha1:9edd4f5aee8470dcfd0db04005908f61fbfae8e0</id>
<content type='text'>
Config registers can be used to replace both type and virtual
registers, so mark both features are deprecated and issue a
warning if they're used.

Signed-off-by: Aidan MacDonald &lt;aidanmacdonald.0x0@gmail.com&gt;
Link: https://lore.kernel.org/r/20220623211420.918875-10-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
