mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 05:17:10 +09:00
ODROID-C4: Add wifi/bt combo.
Change-Id: I7aee51cd8c8babcebf3b060f9b09cbd6f00212f1
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
#include <dt-bindings/gpio/meson-g12a-gpio.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
||||
#include <dt-bindings/pwm/meson.h>
|
||||
#include <dt-bindings/pwm/pwm.h>
|
||||
|
||||
/{
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -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
|
||||
|
||||
@@ -37,7 +37,9 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/pwm.h>
|
||||
#if !defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
|
||||
#include <linux/pci.h>
|
||||
#endif
|
||||
#include <linux/amlogic/pwm_meson.h>
|
||||
#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");
|
||||
|
||||
Reference in New Issue
Block a user