From: Kalle Valo <kvalo@kernel.org> To: Bo Jiao <bo.jiao@mediatek.com> Cc: Felix Fietkau <nbd@nbd.name>, linux-wireless <linux-wireless@vger.kernel.org>, Ryder Lee <ryder.lee@mediatek.com>, Xing Song <xing.song@mediatek.com>, Sujuan Chen <sujuan.chen@mediatek.com>, Shayne Chen <shayne.chen@mediatek.com>, "Evelyn Tsai" <evelyn.tsai@mediatek.com>, linux-mediatek <linux-mediatek@lists.infradead.org>, "Peter Chiu" <chui-hao.chiu@mediatek.com> Subject: Re: [PATCH 3/5] mt76: mt7915: add support for MT7986 Date: Tue, 11 Jan 2022 12:41:02 +0200 [thread overview] Message-ID: <87v8yqk11d.fsf@tynnyri.adurom.net> (raw) In-Reply-To: <ca23c9ff8592a6a5d55ce00c4ed991c5e8678a0a.1641886298.git.Bo.Jiao@mediatek.com> (Bo Jiao's message of "Tue, 11 Jan 2022 15:51:06 +0800") Bo Jiao <bo.jiao@mediatek.com> writes: > From: Bo Jiao <Bo.Jiao@mediatek.com> > > 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 <chui-hao.chiu@mediatek.com> > Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> > Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> > Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> > Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com> > Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com> [...] > +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
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@kernel.org> To: Bo Jiao <bo.jiao@mediatek.com> Cc: Felix Fietkau <nbd@nbd.name>, linux-wireless <linux-wireless@vger.kernel.org>, Ryder Lee <ryder.lee@mediatek.com>, Xing Song <xing.song@mediatek.com>, Sujuan Chen <sujuan.chen@mediatek.com>, Shayne Chen <shayne.chen@mediatek.com>, "Evelyn Tsai" <evelyn.tsai@mediatek.com>, linux-mediatek <linux-mediatek@lists.infradead.org>, "Peter Chiu" <chui-hao.chiu@mediatek.com> Subject: Re: [PATCH 3/5] mt76: mt7915: add support for MT7986 Date: Tue, 11 Jan 2022 12:41:02 +0200 [thread overview] Message-ID: <87v8yqk11d.fsf@tynnyri.adurom.net> (raw) In-Reply-To: <ca23c9ff8592a6a5d55ce00c4ed991c5e8678a0a.1641886298.git.Bo.Jiao@mediatek.com> (Bo Jiao's message of "Tue, 11 Jan 2022 15:51:06 +0800") Bo Jiao <bo.jiao@mediatek.com> writes: > From: Bo Jiao <Bo.Jiao@mediatek.com> > > 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 <chui-hao.chiu@mediatek.com> > Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> > Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> > Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> > Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com> > Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com> [...] > +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 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2022-01-11 10:41 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-11 7:51 [PATCH 1/5] dt-bindings: net: wireless: mt76: document bindings for MT7986 Bo Jiao 2022-01-11 7:51 ` Bo Jiao 2022-01-11 7:51 ` [PATCH 2/5] mt76: rework dma.c to adapt mt7986 changes Bo Jiao 2022-01-11 7:51 ` Bo Jiao 2022-01-11 8:21 ` Felix Fietkau 2022-01-11 8:21 ` Felix Fietkau 2022-01-11 7:51 ` [PATCH 3/5] mt76: mt7915: add support for MT7986 Bo Jiao 2022-01-11 7:51 ` Bo Jiao 2022-01-11 10:41 ` Kalle Valo [this message] 2022-01-11 10:41 ` Kalle Valo 2022-01-11 7:51 ` [PATCH 4/5] mt76: mt7915: add Kconfig entry " Bo Jiao 2022-01-11 7:51 ` Bo Jiao 2022-01-11 10:43 ` Kalle Valo 2022-01-11 10:43 ` Kalle Valo 2022-01-11 7:51 ` [PATCH 5/5] mt76: mt7915: introduce band_idx in mt7915_phy Bo Jiao 2022-01-11 7:51 ` Bo Jiao
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=87v8yqk11d.fsf@tynnyri.adurom.net \ --to=kvalo@kernel.org \ --cc=bo.jiao@mediatek.com \ --cc=chui-hao.chiu@mediatek.com \ --cc=evelyn.tsai@mediatek.com \ --cc=linux-mediatek@lists.infradead.org \ --cc=linux-wireless@vger.kernel.org \ --cc=nbd@nbd.name \ --cc=ryder.lee@mediatek.com \ --cc=shayne.chen@mediatek.com \ --cc=sujuan.chen@mediatek.com \ --cc=xing.song@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.