mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: Rex-BC Chen <rex-bc.chen@mediatek.com>,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	matthias.bgg@gmail.com
Cc: neal.liu@mediatek.com, runyang.chen@mediatek.com,
	linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Project_Global_Chrome_Upstream_Group@mediatek.com
Subject: Re: [PATCH 2/2] soc: mediatek: devapc: Add support for MT8186
Date: Wed, 4 May 2022 11:34:15 +0200	[thread overview]
Message-ID: <3bd77be6-82ea-8c24-242a-0ee486ce888c@collabora.com> (raw)
In-Reply-To: <20220429065429.7957-3-rex-bc.chen@mediatek.com>

Il 29/04/22 08:54, Rex-BC Chen ha scritto:
> Add devapc data and compatible to support MT8186 devapc.
> 
> Signed-off-by: Runyang Chen <runyang.chen@mediatek.com>
> Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
> ---
>   drivers/soc/mediatek/mtk-devapc.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/soc/mediatek/mtk-devapc.c b/drivers/soc/mediatek/mtk-devapc.c
> index 7c65ad3d1f8a..762e0e4d967d 100644
> --- a/drivers/soc/mediatek/mtk-devapc.c
> +++ b/drivers/soc/mediatek/mtk-devapc.c
> @@ -227,10 +227,25 @@ static const struct mtk_devapc_data devapc_mt6779 = {
>   	.vio_shift_con_offset = 0xF20,
>   };
>   
> +static const struct mtk_devapc_data devapc_mt8186 = {
> +	.vio_idx_num = 519,
> +	.vio_mask_offset = 0x0,
> +	.vio_sta_offset = 0x400,
> +	.vio_dbg0_offset = 0x900,
> +	.vio_dbg1_offset = 0x904,
> +	.apc_con_offset = 0xF00,
> +	.vio_shift_sta_offset = 0xF10,
> +	.vio_shift_sel_offset = 0xF14,
> +	.vio_shift_con_offset = 0xF20,
> +};

Hello Rex,
since the register layout is common across a lot of MediaTek SoCs and basically
only the vio_idx_num wildly varies between them, can you separate this parameter
from the mtk_devapc_data struct?

I propose the following:

struct mtk_devapc_regs {
	/* reg offset */
	u32 vio_mask_offset;
	u32 ... etc
};

struct mtk_devapc_data {
	u32 vio_idx_num;
	const struct mtk_devapc_regs *regs;
};

static const struct mtk_devapc_regs devapc_regs_mt6779 = {
	.vio_mask_offset = 0x0,
	.vio...etc
};

static const struct mtk_devapc_data devapc_mt6779 = {
	.vio_idx_num = 511,
	.regs = devapc_regs_mt6779,
};

static const struct mtk_devapc_data devapc_mt8186 = {
	.vio_idx_num = 519,
	.regs = devapc_regs_mt6779,
};

Regards,
Angelo


  reply	other threads:[~2022-05-04  9:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29  6:54 [PATCH 0/2] Support MediaTek devapc " Rex-BC Chen
2022-04-29  6:54 ` [PATCH 1/2] dt-bindings: soc: mediatek: devapc: Add bindings " Rex-BC Chen
2022-04-29 21:00   ` Krzysztof Kozlowski
2022-05-04  9:36   ` AngeloGioacchino Del Regno
2022-05-07 15:46     ` Chun-Kuang Hu
2022-04-29  6:54 ` [PATCH 2/2] soc: mediatek: devapc: Add support " Rex-BC Chen
2022-05-04  9:34   ` AngeloGioacchino Del Regno [this message]
2022-05-04 10:51     ` Rex-BC Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3bd77be6-82ea-8c24-242a-0ee486ce888c@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=neal.liu@mediatek.com \
    --cc=rex-bc.chen@mediatek.com \
    --cc=robh+dt@kernel.org \
    --cc=runyang.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome