linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v2 02/16] rtw89: 8852c: rfk: add DACK
Date: Mon, 02 May 2022 09:34:56 +0300	[thread overview]
Message-ID: <875ymocui7.fsf@kernel.org> (raw)
In-Reply-To: <20220429071809.32104-3-pkshih@realtek.com> (Ping-Ke Shih's message of "Fri, 29 Apr 2022 15:17:55 +0800")

Ping-Ke Shih <pkshih@realtek.com> writes:

> DACK (digital-to-analog converters calibration) is used to calibrate DAC
> to output analog signals as expected.
>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

[...]

> +static void _dack_reload_by_path(struct rtw89_dev *rtwdev,
> +				 enum rtw89_rf_path path, u8 index)
> +{
> +	struct rtw89_dack_info *dack = &rtwdev->dack;
> +	u32 idx_offset, path_offset;
> +	u32 val32, offset, addr;
> +	u8 i;
> +
> +	idx_offset = (index == 0 ? 0 : 0x14);
> +	path_offset = (path == RF_PATH_A ? 0 : 0x28);
> +	offset = idx_offset + path_offset;
> +
> +	rtw89_rfk_parser(rtwdev, &rtw8852c_dack_reload_defs_tbl);
> +	/* msbk_d: 15/14/13/12 */
> +	val32 = 0x0;
> +	for (i = 0; i < RTW89_DACK_MSBK_NR / 4; i++)
> +		val32 |= dack->msbk_d[path][index][i + 12] << (i * 8);
> +	addr = 0xc200 + offset;
> +	rtw89_phy_write32(rtwdev, addr, val32);
> +	rtw89_debug(rtwdev, RTW89_DBG_RFK, "[DACK]0x%x=0x%x\n", addr,
> +		    rtw89_phy_read32_mask(rtwdev, addr, MASKDWORD));
> +	/* msbk_d: 11/10/9/8 */
> +	val32 = 0x0;
> +	for (i = 0; i < RTW89_DACK_MSBK_NR / 4; i++)
> +		val32 |= dack->msbk_d[path][index][i + 8] << (i * 8);
> +	addr = 0xc204 + offset;
> +	rtw89_phy_write32(rtwdev, addr, val32);
> +	rtw89_debug(rtwdev, RTW89_DBG_RFK, "[DACK]0x%x=0x%x\n", addr,
> +		    rtw89_phy_read32_mask(rtwdev, addr, MASKDWORD));
> +	/* msbk_d: 7/6/5/4 */
> +	val32 = 0x0;
> +	for (i = 0; i < RTW89_DACK_MSBK_NR / 4; i++)
> +		val32 |= dack->msbk_d[path][index][i + 4] << (i * 8);
> +	addr = 0xc208 + offset;
> +	rtw89_phy_write32(rtwdev, addr, val32);
> +	rtw89_debug(rtwdev, RTW89_DBG_RFK, "[DACK]0x%x=0x%x\n", addr,
> +		    rtw89_phy_read32_mask(rtwdev, addr, MASKDWORD));
> +	/* msbk_d: 3/2/1/0 */
> +	val32 = 0x0;
> +	for (i = 0; i < RTW89_DACK_MSBK_NR / 4; i++)
> +		val32 |= dack->msbk_d[path][index][i] << (i * 8);
> +	addr = 0xc20c + offset;
> +	rtw89_phy_write32(rtwdev, addr, val32);
> +	rtw89_debug(rtwdev, RTW89_DBG_RFK, "[DACK]0x%x=0x%x\n", addr,
> +		    rtw89_phy_read32_mask(rtwdev, addr, MASKDWORD));
> +	/* dadak_d/biask_d */
> +	val32 = (dack->biask_d[path][index] << 22) |
> +		(dack->dadck_d[path][index] << 14);
> +	addr = 0xc210 + offset;
> +	rtw89_phy_write32(rtwdev, addr, val32);
> +	rtw89_phy_write32_set(rtwdev, addr, BIT(1));
> +}

This function is hard to read. Please add some empty lines to make it
more it readable, preferably before the comments.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2022-05-02  6:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29  7:17 [PATCH v2 00/16] rtw89: 8852c: add RFK and then enable 8852ce in Makefile and Kconfig Ping-Ke Shih
2022-04-29  7:17 ` [PATCH v2 01/16] rtw89: 8852c: rfk: add RFK tables Ping-Ke Shih
2022-05-02  6:45   ` Kalle Valo
2022-05-03  0:05     ` Pkshih
2022-04-29  7:17 ` [PATCH v2 02/16] rtw89: 8852c: rfk: add DACK Ping-Ke Shih
2022-05-02  6:34   ` Kalle Valo [this message]
2022-04-29  7:17 ` [PATCH v2 03/16] rtw89: 8852c: rfk: add LCK Ping-Ke Shih
2022-04-29  7:17 ` [PATCH v2 04/16] rtw89: 8852c: rfk: add TSSI Ping-Ke Shih
2022-05-02  6:39   ` Kalle Valo
2022-04-29  7:17 ` [PATCH v2 05/16] rtw89: 8852c: rfk: add RCK Ping-Ke Shih
2022-04-29  7:17 ` [PATCH v2 06/16] rtw89: 8852c: rfk: add RX DCK Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 07/16] rtw89: 8852c: rfk: add IQK Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 08/16] rtw89: 8852c: rfk: add DPK Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 09/16] rtw89: 8852c: rfk: get calibrated channels to notify firmware Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 10/16] rtw89: 8852c: add chip_ops::bb_ctrl_btc_preagc Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 11/16] rtw89: 8852c: add basic and remaining chip_info Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 12/16] rtw89: ps: fine tune polling interval while changing low power mode Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 13/16] rtw89: correct AID settings of beamformee Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 14/16] rtw89: 8852c: correct register definitions used by 8852c Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 15/16] rtw89: 8852c: fix warning of FIELD_PREP() mask type Ping-Ke Shih
2022-04-29  7:18 ` [PATCH v2 16/16] rtw89: 8852c: add 8852ce to Makefile and Kconfig Ping-Ke Shih

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=875ymocui7.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.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).