From 875d61369c599a2814473e278cf72a9dfa7a4b08 Mon Sep 17 00:00:00 2001 From: Xianjun Jiao Date: Tue, 17 Jan 2023 14:05:47 +0100 Subject: [PATCH] Necessary kernel driver patches and kernel_patch_readme.md --- kernel_boot/ad9361.patch | 68 ++++++++++++++++++++++++++++++ kernel_boot/ad9361_conv.patch | 14 ++++++ kernel_boot/axi_hdmi_crtc.patch | 13 ++++++ kernel_boot/kernel_patch_readme.md | 6 +++ 4 files changed, 101 insertions(+) create mode 100644 kernel_boot/ad9361.patch create mode 100644 kernel_boot/ad9361_conv.patch create mode 100644 kernel_boot/axi_hdmi_crtc.patch create mode 100644 kernel_boot/kernel_patch_readme.md diff --git a/kernel_boot/ad9361.patch b/kernel_boot/ad9361.patch new file mode 100644 index 0000000..30e6cc8 --- /dev/null +++ b/kernel_boot/ad9361.patch @@ -0,0 +1,68 @@ +diff --git a/drivers/iio/adc/ad9361.c b/drivers/iio/adc/ad9361.c +index b21e2129e27c..b53d7b7ab20d 100644 +--- a/drivers/iio/adc/ad9361.c ++++ b/drivers/iio/adc/ad9361.c +@@ -1234,7 +1234,7 @@ static int ad9361_load_mixer_gm_subtable(struct ad9361_rf_phy *phy) + return 0; + } + +-static int ad9361_set_tx_atten(struct ad9361_rf_phy *phy, u32 atten_mdb, ++int ad9361_set_tx_atten(struct ad9361_rf_phy *phy, u32 atten_mdb, + bool tx1, bool tx2, bool immed) + { + u8 buf[2]; +@@ -1266,8 +1266,8 @@ static int ad9361_set_tx_atten(struct ad9361_rf_phy *phy, u32 atten_mdb, + + return ret; + } +- +-static int ad9361_get_tx_atten(struct ad9361_rf_phy *phy, u32 tx_num) ++EXPORT_SYMBOL(ad9361_set_tx_atten); ++int ad9361_get_tx_atten(struct ad9361_rf_phy *phy, u32 tx_num) + { + u8 buf[2]; + int ret = 0; +@@ -1285,7 +1285,7 @@ static int ad9361_get_tx_atten(struct ad9361_rf_phy *phy, u32 tx_num) + + return code; + } +- ++EXPORT_SYMBOL(ad9361_get_tx_atten); + int ad9361_tx_mute(struct ad9361_rf_phy *phy, u32 state) + { + struct ad9361_rf_phy_state *st = phy->state; +@@ -3744,7 +3744,7 @@ static int ad9361_get_auxadc(struct ad9361_rf_phy *phy) + // Setup Control Outs + //************************************************************ + +-static int ad9361_ctrl_outs_setup(struct ad9361_rf_phy *phy, ++int ad9361_ctrl_outs_setup(struct ad9361_rf_phy *phy, + struct ctrl_outs_control *ctrl) + { + struct spi_device *spi = phy->spi; +@@ -3754,6 +3754,7 @@ static int ad9361_ctrl_outs_setup(struct ad9361_rf_phy *phy, + ad9361_spi_write(spi, REG_CTRL_OUTPUT_POINTER, ctrl->index); // Ctrl Out index + return ad9361_spi_write(spi, REG_CTRL_OUTPUT_ENABLE, ctrl->en_mask); // Ctrl Out [7:0] output enable + } ++EXPORT_SYMBOL(ad9361_ctrl_outs_setup); + //************************************************************ + // Setup GPO + //************************************************************ +@@ -5235,7 +5236,7 @@ static int ad9361_setup(struct ad9361_rf_phy *phy) + + } + +-static int ad9361_do_calib_run(struct ad9361_rf_phy *phy, u32 cal, int arg) ++int ad9361_do_calib_run(struct ad9361_rf_phy *phy, u32 cal, int arg) + { + struct ad9361_rf_phy_state *st = phy->state; + int ret; +@@ -5268,7 +5269,7 @@ static int ad9361_do_calib_run(struct ad9361_rf_phy *phy, u32 cal, int arg) + + return ret; + } +- ++EXPORT_SYMBOL(ad9361_do_calib_run); + static int ad9361_update_rf_bandwidth(struct ad9361_rf_phy *phy, + u32 rf_rx_bw, u32 rf_tx_bw) + { diff --git a/kernel_boot/ad9361_conv.patch b/kernel_boot/ad9361_conv.patch new file mode 100644 index 0000000..bf16d15 --- /dev/null +++ b/kernel_boot/ad9361_conv.patch @@ -0,0 +1,14 @@ +diff --git a/drivers/iio/adc/ad9361_conv.c b/drivers/iio/adc/ad9361_conv.c +index 1902e7d07501..ef421dbd5e70 100644 +--- a/drivers/iio/adc/ad9361_conv.c ++++ b/drivers/iio/adc/ad9361_conv.c +@@ -449,7 +449,8 @@ static int ad9361_dig_tune_delay(struct ad9361_rf_phy *phy, + unsigned long max_freq, + enum dig_tune_flags flags, bool tx) + { +- static const unsigned int rates[3] = {25000000U, 40000000U, 61440000U}; ++ // static const unsigned int rates[3] = {25000000U, 40000000U, 61440000U}; ++ static const unsigned int rates[3] = {25000000U, 40000000U, 40000000U}; + struct axiadc_converter *conv = spi_get_drvdata(phy->spi); + unsigned int s0, s1, c0, c1; + unsigned int i, j, r; diff --git a/kernel_boot/axi_hdmi_crtc.patch b/kernel_boot/axi_hdmi_crtc.patch new file mode 100644 index 0000000..ab7df05 --- /dev/null +++ b/kernel_boot/axi_hdmi_crtc.patch @@ -0,0 +1,13 @@ +diff --git a/drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_crtc.c b/drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_crtc.c +index f24669f623d6..70c5769019fa 100644 +--- a/drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_crtc.c ++++ b/drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_crtc.c +@@ -54,7 +54,7 @@ static struct dma_async_tx_descriptor *axi_hdmi_vdma_prep_interleaved_desc( + memset(&vdma_config, 0, sizeof(vdma_config)); + vdma_config.park = 1; + vdma_config.coalesc = 0xff; +- xilinx_vdma_channel_set_config(axi_hdmi_crtc->dma, &vdma_config); ++ // xilinx_vdma_channel_set_config(axi_hdmi_crtc->dma, &vdma_config); + } + #endif + diff --git a/kernel_boot/kernel_patch_readme.md b/kernel_boot/kernel_patch_readme.md new file mode 100644 index 0000000..b06c54b --- /dev/null +++ b/kernel_boot/kernel_patch_readme.md @@ -0,0 +1,6 @@ +axi_hdmi_crtc.patch to avoid axi hdmi compiling error after enable Xilinx axi dma. + +ad9361.patch to expose some APIs for openwifi driver. + +ad9361_conv.patch to avoid 61.44Msps lvds interface self timing calibration for some low-end/bad hardware (sometimes difficult). +