Ping-Ke Shih <pkshih@xxxxxxxxxxx> 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@xxxxxxxxxxx> [...] > +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