linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
	Shayne Chen <shayne.chen@mediatek.com>,
	Evelyn Tsai <evelyn.tsai@mediatek.com>,
	linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	Ryder Lee <ryder.lee@mediatek.com>,
	Money Wang <money.wang@mediatek.com>
Subject: Re: [PATCH] mt76: mt7915: add LED support
Date: Fri, 27 Aug 2021 19:03:56 +0200	[thread overview]
Message-ID: <046a19be-b804-94a1-7c8c-5c4f3bfa8eac@nbd.name> (raw)
In-Reply-To: <20210621141430.17577-1-MeiChia.Chiu@mediatek.com>


On 2021-06-21 16:14, MeiChia Chiu wrote:
> From: MeiChia Chiu <meichia.chiu@mediatek.com>
> 
> Initialize brightness_set and blink_set callbacks to enable LED support.
> 
> Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Money Wang <money.wang@mediatek.com>
> ---
>  .../net/wireless/mediatek/mt76/mt7915/init.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  .../net/wireless/mediatek/mt76/mt7915/mmio.c |  6 +++--
>  .../net/wireless/mediatek/mt76/mt7915/regs.h | 19 ++++++++++++++
>  3 files changed, 92 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
> index af712a9..43f9245 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
> @@ -92,10 +92,12 @@ static u32 __mt7915_reg_addr(struct mt7915_dev *dev, u32 addr)
>  	}
>  
>  	if ((addr >= 0x18000000 && addr < 0x18c00000) ||
> -	    (addr >= 0x70000000 && addr < 0x78000000) ||
> -	    (addr >= 0x7c000000 && addr < 0x7c400000))
> +	    (addr >= 0x70000000 && addr < 0x78000000))
>  		return mt7915_reg_map_l1(dev, addr);
>  
> +	if (addr >= 0x7c000000 && addr < 0x7c400000)
> +		return mt7915_reg_map_l1(dev, addr - 0x64000000);

This part doesn't make any sense to me. So you're defining registers in
the 0x7c000000 range, but subtracting 0x64000000 from the address, which
means we land at 0x18000000, which is already covered by the l1-mapped
ranges.
Why not just skip this weird magic trick and define the registers as
being in the 0x18000000 range?

- Felix

      parent reply	other threads:[~2021-08-27 17:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 14:14 [PATCH] mt76: mt7915: add LED support MeiChia Chiu
2021-08-13 10:52 ` Felix Fietkau
2021-08-13 16:09   ` Ryder Lee
2021-08-27 17:03 ` Felix Fietkau [this message]

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=046a19be-b804-94a1-7c8c-5c4f3bfa8eac@nbd.name \
    --to=nbd@nbd.name \
    --cc=MeiChia.Chiu@mediatek.com \
    --cc=evelyn.tsai@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=money.wang@mediatek.com \
    --cc=ryder.lee@mediatek.com \
    --cc=shayne.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;
as well as URLs for NNTP newsgroup(s).