Commit a82dfd33 authored by Sascha Hauer's avatar Sascha Hauer Committed by Kalle Valo
Browse files

wifi: rtw88: Add common USB chip support

Add the common bits and pieces to add USB support to the RTW88 driver.
This is based on https://github.com/ulli-kroll/rtw88-usb.git

 which
itself is first written by Neo Jou.

Signed-off-by: default avatarneo_jou <neo_jou@realtek.com>
Signed-off-by: default avatarHans Ulli Kroll <linux@ulli-kroll.de>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221202081224.2779981-8-s.hauer@pengutronix.de
parent 78d5bf92
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@ config RTW88_CORE
config RTW88_PCI
	tristate

config RTW88_USB
	tristate

config RTW88_8822B
	tristate

+3 −0
Original line number Diff line number Diff line
@@ -46,3 +46,6 @@ rtw88_8821ce-objs := rtw8821ce.o

obj-$(CONFIG_RTW88_PCI)		+= rtw88_pci.o
rtw88_pci-objs			:= pci.o

obj-$(CONFIG_RTW88_USB)		+= rtw88_usb.o
rtw88_usb-objs			:= usb.o
+3 −0
Original line number Diff line number Diff line
@@ -1048,6 +1048,9 @@ static int txdma_queue_mapping(struct rtw_dev *rtwdev)
	if (rtw_chip_wcpu_11ac(rtwdev))
		rtw_write32(rtwdev, REG_H2CQ_CSR, BIT_H2CQ_FULL);

	if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB)
		rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_ARBBW_EN);

	return 0;
}

+4 −0
Original line number Diff line number Diff line
@@ -1783,6 +1783,10 @@ static int rtw_chip_parameter_setup(struct rtw_dev *rtwdev)
		rtwdev->hci.rpwm_addr = 0x03d9;
		rtwdev->hci.cpwm_addr = 0x03da;
		break;
	case RTW_HCI_TYPE_USB:
		rtwdev->hci.rpwm_addr = 0xfe58;
		rtwdev->hci.cpwm_addr = 0xfe57;
		break;
	default:
		rtw_err(rtwdev, "unsupported hci type\n");
		return -EINVAL;
+4 −0
Original line number Diff line number Diff line
@@ -871,6 +871,10 @@ struct rtw_chip_ops {
			       bool is_tx2_path);
	void (*config_txrx_mode)(struct rtw_dev *rtwdev, u8 tx_path,
				 u8 rx_path, bool is_tx2_path);
	/* for USB/SDIO only */
	void (*fill_txdesc_checksum)(struct rtw_dev *rtwdev,
				     struct rtw_tx_pkt_info *pkt_info,
				     u8 *txdesc);

	/* for coex */
	void (*coex_set_init)(struct rtw_dev *rtwdev);
Loading