diff --git a/arch/arm64/boot/dts/amlogic/overlays/odroidc4/wifi_bt_combo.dts b/arch/arm64/boot/dts/amlogic/overlays/odroidc4/wifi_bt_combo.dts new file mode 100644 index 000000000000..35c24e77e108 --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/overlays/odroidc4/wifi_bt_combo.dts @@ -0,0 +1,65 @@ +/dts-v1/; +/plugin/; + +#include +#include + +#include +#include + +/{ + fragment@0 { + target-path = "/"; + + __overlay__ { + bt-dev { + compatible = "amlogic, bt-dev"; + dev_name = "bt-dev"; + status = "okay"; + gpio_reset = <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; + gpio_hostwake = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>; + gpio_btwakeup = <&gpio GPIOX_18 GPIO_ACTIVE_HIGH>; + }; + + wifi { + compatible = "amlogic, aml_wifi"; + dev_name = "aml_wifi"; + status = "okay"; + interrupt_pin = <&gpio GPIOX_7 GPIO_ACTIVE_LOW>; + irq_trigger_type = "GPIO_IRQ_HIGH"; + power_on_pin = <&gpio GPIOX_6 GPIO_ACTIVE_HIGH>; + dhd_static_buf; //if use bcm wifi, config dhd_static_buf + pinctrl-names = "default"; + pinctrl-0 = <&pwm_e_pins>; + pwms = <&pwm_ef MESON_PWM_0 30541 0>; + duty_cycle = <15270>; + }; + }; + }; + + fragment@1 { + target = <&uart_A>; + + __overlay__ { + status = "okay"; + }; + }; + + fragment@2 { + target = <&pwm_ef>; + + __overlay__ { + status = "okay"; + pinctrl-names = "pwm_pins"; + pinctrl-0 = <&pwm_e_pins>; + }; + }; + + fragment@3 { + target = <&sd_emmc_a>; + + __overlay__ { + status = "okay"; + }; + }; +}; diff --git a/arch/arm64/configs/odroidg12_defconfig b/arch/arm64/configs/odroidg12_defconfig index 48a65edb592d..0621f912d490 100644 --- a/arch/arm64/configs/odroidg12_defconfig +++ b/arch/arm64/configs/odroidg12_defconfig @@ -1820,8 +1820,8 @@ CONFIG_AMLOGIC_WDT_MESON_V3=y # ESM Support # CONFIG_AMLOGIC_ESM=y -# CONFIG_AMLOGIC_WIFI is not set -# CONFIG_AMLOGIC_BT_DEVICE is not set +CONFIG_AMLOGIC_WIFI=y +CONFIG_AMLOGIC_BT_DEVICE=y # # DVB COMPAT support diff --git a/drivers/amlogic/wifi/wifi_dt.c b/drivers/amlogic/wifi/wifi_dt.c index 6ef9ca237a31..641269ac544b 100644 --- a/drivers/amlogic/wifi/wifi_dt.c +++ b/drivers/amlogic/wifi/wifi_dt.c @@ -37,7 +37,9 @@ #include #include #include +#if !defined(CONFIG_ARCH_MESON64_ODROID_COMMON) #include +#endif #include #include "../../gpio/gpiolib.h" #define OWNER_NAME "sdio_wifi" @@ -252,7 +254,7 @@ static int wifi_power_release(struct inode *inode, struct file *file) return 0; } - +#if !defined(CONFIG_ARCH_MESON64_ODROID_COMMON) void pci_reinit(void) { struct pci_bus *bus = NULL; @@ -312,6 +314,7 @@ void pci_remove_reinit(unsigned int vid, unsigned int pid, unsigned int delBus) } EXPORT_SYMBOL(pci_remove_reinit); +#endif static long wifi_power_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) @@ -334,7 +337,9 @@ static long wifi_power_ioctl(struct file *filp, mdelay(200); set_usb_wifi_power(1); mdelay(200); +#if !defined(CONFIG_ARCH_MESON64_ODROID_COMMON) pci_reinit(); +#endif WIFI_INFO("Set sdio wifi power up!\n"); break; case WIFI_POWER_DOWN: @@ -664,7 +669,12 @@ static int wifi_dev_probe(struct platform_device *pdev) plat->power_on_pin2 = desc_to_gpio(desc); } - if (get_cpu_type() >= MESON_CPU_MAJOR_ID_GXTVBB) { + if (get_cpu_type() == MESON_CPU_MAJOR_ID_SM1) { + WIFI_INFO("set pwm as 32k output\n"); + ret = pwm_single_channel_conf(plat); + if (ret) + pr_err("pwm config err\n"); + } else if (get_cpu_type() >= MESON_CPU_MAJOR_ID_GXTVBB) { ret = pwm_double_channel_conf_dt(plat); if (ret != 0) { WIFI_INFO("pwm_double_channel_conf_dt error\n");