Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D868C433EF for ; Tue, 11 Jan 2022 10:41:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349319AbiAKKlL (ORCPT ); Tue, 11 Jan 2022 05:41:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349320AbiAKKlK (ORCPT ); Tue, 11 Jan 2022 05:41:10 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 541F3C061748 for ; Tue, 11 Jan 2022 02:41:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 052AFB81A0C for ; Tue, 11 Jan 2022 10:41:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D90D8C36AE3; Tue, 11 Jan 2022 10:41:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641897666; bh=YBNlvtz/hsz0QFXydHoTdn6FzRUpbkfD7u6+C9vGXJU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=VL7Zj4McOwvDAdKl7h7p+EDHOr3zSMBRvaCF6eOfnfKnyfOYyYmu9Ldxh0c1BPDE9 cStPO7qMCiTL1mnrbGu1ahsxKgHNBTCdGeO53J54kmTkqOXsUV2I3qv+MR7PVk4/dz JY30L7T+8gvLSJfORCxXepFz7gWt9PkvlOLohFdwz77G80CbyPlBwzwvFhrn3yftXl otGD5cO0keyAQdkAcUeuoEfuVDIaxFwle8Jr5pBFXEftWJC9eqdDtA2xbAxjZINiJg R17yQIlfONpXLPCv8wdEYJd2A4cRm4o46S1g+6+6XQpaugrSgps+RrTwpK3Sk3zuGF i4k/aNPmyfhHg== From: Kalle Valo To: Bo Jiao Cc: Felix Fietkau , linux-wireless , Ryder Lee , Xing Song , Sujuan Chen , Shayne Chen , "Evelyn Tsai" , linux-mediatek , "Peter Chiu" Subject: Re: [PATCH 3/5] mt76: mt7915: add support for MT7986 References: <351271a274dc236f027c58487df6b21c7dbf9fd0.1641886298.git.Bo.Jiao@mediatek.com> Date: Tue, 11 Jan 2022 12:41:02 +0200 In-Reply-To: (Bo Jiao's message of "Tue, 11 Jan 2022 15:51:06 +0800") Message-ID: <87v8yqk11d.fsf@tynnyri.adurom.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Bo Jiao writes: > From: Bo Jiao > > This adds MT7986 SoC integrated multi-band 4x4 WiFi 6/6E. > Detailed link: https://www.mediatek.com/products/mediatek-filogic-830 > > Co-developed-by: Peter Chiu > Signed-off-by: Peter Chiu > Co-developed-by: Ryder Lee > Signed-off-by: Ryder Lee > Signed-off-by: Sujuan Chen > Signed-off-by: Bo Jiao [...] > +static int mt7986_wmac_adie_patch_7975(struct mt7915_dev *dev, u8 adie) > +{ > + if (/* disable CAL LDO and fine tune RFDIG LDO */ > + mt76_wmac_spi_write(dev, adie, 0x348, 0x00000002) || > + mt76_wmac_spi_write(dev, adie, 0x378, 0x00000002) || > + mt76_wmac_spi_write(dev, adie, 0x3a8, 0x00000002) || > + mt76_wmac_spi_write(dev, adie, 0x3d8, 0x00000002) || > + /* set CKA driving and filter */ > + mt76_wmac_spi_write(dev, adie, 0xa1c, 0x30000aaa) || > + /* set CKB LDO to 1.4V */ > + mt76_wmac_spi_write(dev, adie, 0xa84, 0x8470008a) || > + /* turn on SX0 LTBUF */ > + mt76_wmac_spi_write(dev, adie, 0x074, 0x00000002) || > + /* CK_BUF_SW_EN = 1 (all buf in manual mode.) */ > + mt76_wmac_spi_write(dev, adie, 0xaa4, 0x01001fc0) || > + /* BT mode/WF normal mode 00000005 */ > + mt76_wmac_spi_write(dev, adie, 0x070, 0x00000005) || > + /* BG thermal sensor offset update */ > + mt76_wmac_spi_write(dev, adie, 0x344, 0x00000088) || > + mt76_wmac_spi_write(dev, adie, 0x374, 0x00000088) || > + mt76_wmac_spi_write(dev, adie, 0x3a4, 0x00000088) || > + mt76_wmac_spi_write(dev, adie, 0x3d4, 0x00000088) || > + /* set WCON VDD IPTAT to "0000" */ > + mt76_wmac_spi_write(dev, adie, 0xa80, 0x44d07000) || > + /* change back LTBUF SX3 drving to default value */ > + mt76_wmac_spi_write(dev, adie, 0xa88, 0x3900aaaa) || > + /* SM input cap off */ > + mt76_wmac_spi_write(dev, adie, 0x2c4, 0x00000000) || > + /* set CKB driving and filter */ > + mt76_wmac_spi_write(dev, adie, 0x2c8, 0x00000072)) > + return -ETIMEDOUT; > + > + return 0; > +} This function is hard to read and just weird. In upstream we prefer readibility over saving few lines of code. This style takes few lines more but it's so much easier to read: ret = foo() if (ret) return ret; -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches