[PATCH v3 6/7] soc: mediatek: mmsys: Add reset controller support

Hsin-Yi Wang hsinyi at chromium.org
Wed Sep 15 23:05:25 PDT 2021


On Wed, Aug 25, 2021 at 6:26 PM Enric Balletbo i Serra
<enric.balletbo at collabora.com> wrote:
>
> Among other features the mmsys driver should implement a reset
> controller to be able to reset different bits from their space.
>
> Cc: Jitao Shi <jitao.shi at mediatek.com>
> Suggested-by: Chun-Kuang Hu <chunkuang.hu at kernel.org>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo at collabora.com>
> Reviewed-by: Philipp Zabel <p.zabel at pengutronix.de>
> ---
>
> (no changes since v1)
>
<snip>
> +static int mtk_mmsys_reset_update(struct reset_controller_dev *rcdev, unsigned long id,
> +                                 bool assert)
> +{
> +       struct mtk_mmsys *mmsys = container_of(rcdev, struct mtk_mmsys, rcdev);
> +       unsigned long flags;
> +       u32 reg;
> +       int i;
This variable is not used.

> +
> +       spin_lock_irqsave(&mmsys->lock, flags);
> +
> +       reg = readl_relaxed(mmsys->regs + MMSYS_SW0_RST_B);
> +
> +       if (assert)
> +               reg &= ~BIT(id);
> +       else
> +               reg |= BIT(id);
> +
> +       writel_relaxed(reg, mmsys->regs + MMSYS_SW0_RST_B);
> +
> +       spin_unlock_irqrestore(&mmsys->lock, flags);
> +
> +       return 0;
> +}
> +
<snip>



More information about the linux-arm-kernel mailing list