Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1495089pxb; Fri, 27 Aug 2021 10:04:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWOY+qrDJYa21gB3cyxO7lRdf/LJqJR/slVT9AvI3Ao+VT88Tr/O2ktO0Ec5Bbp3Muu/pu X-Received: by 2002:a05:6638:304a:: with SMTP id u10mr9235906jak.62.1630083887970; Fri, 27 Aug 2021 10:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630083887; cv=none; d=google.com; s=arc-20160816; b=GyjG4s6FfLoLhcs+UgzU9gb2LogfDG2nbgvTcQGdweTXpdv0/nDWvHfbdW+60gdYj3 kxFDJnYrsD+XoywMm7ty/IR2bZAbvHRLJM3UF17Ob6Cau6x+rvlrK3qsdAUw/bZg1dj/ 6/LZYywyJP1Di1NwqXzQhLfbtRRYNAVU6lQ2awrGoaBAqMRRly+LrSZheNqZYQahp5KX XhPyui/56z1TgC6k5KpwiKS3K9Yg2vfBao9PXlgxOm6el34HB4Ggb+kWlEa7x9JtxdQs 6zshxXGq5AdVSLYNf4brTlfF32kidPi/utJ3hS/n4sGKb8+bzNnZ6u9eDdPRtF8771J7 QyjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Zp2Jx2p4tyFPvaHoFkrRw0ec88lvZ1SKolJlkPGdft8=; b=cOpGQsvyHpzgta0Vk0QjXlltRyEI82bQaRzQv3qp6Q/f65anCpN6ouT3j6d/8zj2kZ cFV71H8oG1IytdNjSMluPpxS8QPUmCVgDjl7s+mgDfBWIXKateNTywrP+EmiXVJBb6NH wSGP0rW7blV36peyqRZJsYkSYrwrT/s859CPEyFkDKKhvbISdb9owCftu3qvuLMHiYv+ /J3U5SM1gKIHgHF6mROudUr/qgdtfGa3uKKERf96v8wRQMz7HzAoeQgAwz7+5vGAPoMK dN3n3NpZEbRA7+n/PGRsJfRJRtOHhqvnxtkVBms6578qQbQkJPJox3gs6CKhWqlAXg4Z af/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=i2J5Q3kj; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z26si6096155ioc.55.2021.08.27.10.04.30; Fri, 27 Aug 2021 10:04:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=i2J5Q3kj; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbhH0REv (ORCPT + 99 others); Fri, 27 Aug 2021 13:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233113AbhH0REu (ORCPT ); Fri, 27 Aug 2021 13:04:50 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89E53C061757 for ; Fri, 27 Aug 2021 10:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Zp2Jx2p4tyFPvaHoFkrRw0ec88lvZ1SKolJlkPGdft8=; b=i2J5Q3kjc5aXG+VEbm2JnxnDAb mzEeEu22XhGhP6CAKVaZW3tuWWjdJIQpJFx4VzPnb8e286EdnvwLxUclpRCyXxzPTcB0oiQljiYzl 5GqJ7byPurzj4ZSpE6Fo2kCgjLd6/kApXMe2l4h/eJh7aZzm880fnWQlS/41nn9AvQRE=; Received: from p4ff13206.dip0.t-ipconnect.de ([79.241.50.6] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1mJfGn-0007hd-89; Fri, 27 Aug 2021 19:03:57 +0200 Subject: Re: [PATCH] mt76: mt7915: add LED support To: MeiChia Chiu Cc: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org, Ryder Lee , Money Wang References: <20210621141430.17577-1-MeiChia.Chiu@mediatek.com> From: Felix Fietkau Message-ID: <046a19be-b804-94a1-7c8c-5c4f3bfa8eac@nbd.name> Date: Fri, 27 Aug 2021 19:03:56 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210621141430.17577-1-MeiChia.Chiu@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2021-06-21 16:14, MeiChia Chiu wrote: > From: MeiChia Chiu > > Initialize brightness_set and blink_set callbacks to enable LED support. > > Signed-off-by: MeiChia Chiu > Signed-off-by: Ryder Lee > Signed-off-by: Money Wang > --- > .../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