<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/clk/mediatek/reset.c, branch v7.0.10</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.0.10</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.0.10'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-07-29T23:11:08+00:00</updated>
<entry>
<title>clk: mediatek: reset: Remove unused mtk_register_reset_controller()</title>
<updated>2024-07-29T23:11:08+00:00</updated>
<author>
<name>AngeloGioacchino Del Regno</name>
<email>angelogioacchino.delregno@collabora.com</email>
</author>
<published>2024-07-18T08:25:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a9e56f25633989238fc7b233e100e295ee33739'/>
<id>urn:sha1:4a9e56f25633989238fc7b233e100e295ee33739</id>
<content type='text'>
Now that all clock controllers have been migrated to the new
mtk_register_reset_controller_with_dev() function, the one taking
struct device node is now unused: remove it.

Signed-off-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Link: https://lore.kernel.org/r/20240718082528.220750-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: mediatek: reset: Return regmap's error code</title>
<updated>2024-07-29T23:01:23+00:00</updated>
<author>
<name>Fei Shao</name>
<email>fshao@chromium.org</email>
</author>
<published>2024-07-17T11:58:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ae8ca031f590dc2c33f0f0286034d34e629099ce'/>
<id>urn:sha1:ae8ca031f590dc2c33f0f0286034d34e629099ce</id>
<content type='text'>
device_node_to_regmap() can return different errors, and it's better
practice to pass them to callers.

Clean up the hardcoded -EINVAL and use PTR_ERR(regmap) instead.

Signed-off-by: Fei Shao &lt;fshao@chromium.org&gt;
Link: https://lore.kernel.org/r/20240717115919.975474-1-fshao@chromium.org
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: mediatek: Export required symbols to compile clk drivers as module</title>
<updated>2022-09-26T03:13:09+00:00</updated>
<author>
<name>AngeloGioacchino Del Regno</name>
<email>angelogioacchino.delregno@collabora.com</email>
</author>
<published>2022-09-21T09:14:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7cbe5cb291fa3cbd069152f8f955bff06b851923'/>
<id>urn:sha1:7cbe5cb291fa3cbd069152f8f955bff06b851923</id>
<content type='text'>
In order to compile the clock drivers for various MediaTek SoCs as
modules, it is necessary to export a few functions from the MediaTek
specific clocks (and reset) libraries.

Signed-off-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Miles Chen &lt;miles.chen@mediatek.com&gt;
Link: https://lore.kernel.org/r/20220921091455.41327-7-angelogioacchino.delregno@collabora.com
Signed-off-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
</content>
</entry>
<entry>
<title>clk: mediatek: reset: Add new register reset function with device</title>
<updated>2022-06-16T00:24:13+00:00</updated>
<author>
<name>Rex-BC Chen</name>
<email>rex-bc.chen@mediatek.com</email>
</author>
<published>2022-05-23T09:33:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=761bc64003e38119ce4687424ef56de3976fe26c'/>
<id>urn:sha1:761bc64003e38119ce4687424ef56de3976fe26c</id>
<content type='text'>
Using device to register reset controller is a better implementation in
current drivers. Howerver, some clock drviers of MediaTek only provide
device_node.

Therefore, we still remain the register reset function with device_node
and add a new function with device to register reset controller.

Signed-off-by: Rex-BC Chen &lt;rex-bc.chen@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Tested-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Link: https://lore.kernel.org/r/20220523093346.28493-11-rex-bc.chen@mediatek.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: mediatek: reset: Change return type for clock reset register function</title>
<updated>2022-06-16T00:24:12+00:00</updated>
<author>
<name>Rex-BC Chen</name>
<email>rex-bc.chen@mediatek.com</email>
</author>
<published>2022-05-23T09:33:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7d10ae3797e1aea48d7635685d3b9c3bdf2bc56e'/>
<id>urn:sha1:7d10ae3797e1aea48d7635685d3b9c3bdf2bc56e</id>
<content type='text'>
To deal with error handling, we change the function return type from
void to int for mtk_clk_register_rst_ctrl().

Signed-off-by: Rex-BC Chen &lt;rex-bc.chen@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Tested-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Link: https://lore.kernel.org/r/20220523093346.28493-10-rex-bc.chen@mediatek.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: mediatek: reset: Support inuput argument index mode</title>
<updated>2022-06-16T00:24:12+00:00</updated>
<author>
<name>Rex-BC Chen</name>
<email>rex-bc.chen@mediatek.com</email>
</author>
<published>2022-05-23T09:33:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=322989ddf7c478a9cbbb51da0d4b51825a47735d'/>
<id>urn:sha1:322989ddf7c478a9cbbb51da0d4b51825a47735d</id>
<content type='text'>
There is a large number of mediatek infra reset bits, but we do not use
all of them. In addition, the proper input argement of reset controller
soulde be index.
Therefore, to be compatible with previous drivers and usage, we add
description variables to store the ids which can mapping to index.

To use this mode, we need to put the id in rst_idx_map to map from
index to ids. For example, if we want to input index 1 (this index
is used to set bank 1 bit 14) for svs, we need to declare the reset
controller like this:

In drivers:
static u16 rst_ofs[] = {
        0x120, 0x130, 0x140, 0x150, 0x730,
};

static u16 rst_idx_map[] = {
        0 * 32 + 0,
        1 * 32 + 14,
        ....
};

static const struct mtk_clk_rst_desc clk_rst_desc = {
        .version = MTK_RST_SET_CLR,
        .rst_bank_ofs = rst_ofs,
        .rst_bank_nr = ARRAY_SIZE(rst_ofs),
        .rst_idx_map = rst_idx_map,
        .rst_idx_map_nr = ARRAY_SIZE(rst_idx_map),
};

In dts:
svs: {
        ...
        resets = &lt;&amp;infra 1&gt;;
        ...
};

Signed-off-by: Rex-BC Chen &lt;rex-bc.chen@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Tested-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Link: https://lore.kernel.org/r/20220523093346.28493-9-rex-bc.chen@mediatek.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: mediatek: reset: Support nonsequence base offsets of reset registers</title>
<updated>2022-06-16T00:24:12+00:00</updated>
<author>
<name>Rex-BC Chen</name>
<email>rex-bc.chen@mediatek.com</email>
</author>
<published>2022-05-23T09:33:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=723e367114dec95abe8bba4118c4c7c3542a463f'/>
<id>urn:sha1:723e367114dec95abe8bba4118c4c7c3542a463f</id>
<content type='text'>
The bank offsets are not serial for all reset registers.
For example, there are five infra reset banks for MT8192: 0x120, 0x130,
0x140, 0x150 and 0x730.

To support this,
- Change reg_ofs to rst_bank_ofs which is a pointer to base offsets of
  the reset register.
- Add a new define RST_NR_PER_BANK to define reset number for each
  reset bank.

Signed-off-by: Rex-BC Chen &lt;rex-bc.chen@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Tested-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Link: https://lore.kernel.org/r/20220523093346.28493-8-rex-bc.chen@mediatek.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: mediatek: reset: Revise structure to control reset register</title>
<updated>2022-06-16T00:24:12+00:00</updated>
<author>
<name>Rex-BC Chen</name>
<email>rex-bc.chen@mediatek.com</email>
</author>
<published>2022-05-23T09:33:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2d2a2900588cabe2ff3abd552d1683e5f1ce398b'/>
<id>urn:sha1:2d2a2900588cabe2ff3abd552d1683e5f1ce398b</id>
<content type='text'>
To declare the reset data easier, we add a strucure to do this instead
of using many input variables to mtk_register_reset_controller().

- Add mtk_clk_rst_desc to define the reset description when registering
  the reset controller.
- Rename "mtk_reset" to "mtk_clk_rst_data". We use it to store data of
  reset controller.
- Document mtk_clk_rst_desc and mtk_clk_rst_data.
- Modify the documentation of mtk_register_reset_controller.
- Extract container_of in update functions to to_mtk_clk_rst_data().

Signed-off-by: Rex-BC Chen &lt;rex-bc.chen@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Tested-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Link: https://lore.kernel.org/r/20220523093346.28493-7-rex-bc.chen@mediatek.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: mediatek: reset: Merge and revise reset register function</title>
<updated>2022-06-16T00:24:12+00:00</updated>
<author>
<name>Rex-BC Chen</name>
<email>rex-bc.chen@mediatek.com</email>
</author>
<published>2022-05-23T09:33:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=370bf62869695003c2994d3d98769ccde6b26083'/>
<id>urn:sha1:370bf62869695003c2994d3d98769ccde6b26083</id>
<content type='text'>
There are two versions for clock reset register control for MediaTek
SoCs. The old hardware is one bit per reset control, and does not
have separate registers for bit set, clear and read-back operations.
This matches the scheme supported by the simple reset driver.

However, because we need to use different data structure from
reset_simple_data, we can not use the operation of simple reset
driver.
For this reason, we keep the original functions and name this version
as "MTK_RST_SIMPLE".

In this patch:
- Add a version enumeration to separate different reset hardware.
- Merge the reset register function of simple and set_clr into one
  function "mtk_register_reset_controller".
- Rename input variable "num_regs" to "rst_bank_nr" to avoid
  confusion. This variable is used to define the quantity of reset bank.
- Document mtk_reset_version and mtk_register_reset_controller.

Signed-off-by: Rex-BC Chen &lt;rex-bc.chen@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Tested-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Link: https://lore.kernel.org/r/20220523093346.28493-6-rex-bc.chen@mediatek.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: mediatek: reset: Extract common drivers to update function</title>
<updated>2022-06-16T00:24:12+00:00</updated>
<author>
<name>Rex-BC Chen</name>
<email>rex-bc.chen@mediatek.com</email>
</author>
<published>2022-05-23T09:33:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=114257572a0e0d93f770894b9824793901d1fae7'/>
<id>urn:sha1:114257572a0e0d93f770894b9824793901d1fae7</id>
<content type='text'>
To make drivers more clear and readable, we extract common code
within assert and deassert to mtk_reset_update_set_clr() and
mtk_reset_update().

Signed-off-by: Rex-BC Chen &lt;rex-bc.chen@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Tested-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Link: https://lore.kernel.org/r/20220523093346.28493-5-rex-bc.chen@mediatek.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
</feed>
