diff --git a/root/target/linux/brcm2708/bcm2710/config-4.14 b/root/target/linux/brcm2708/bcm2710/config-4.14 index a686e6e0..c1809092 100644 --- a/root/target/linux/brcm2708/bcm2710/config-4.14 +++ b/root/target/linux/brcm2708/bcm2710/config-4.14 @@ -485,4 +485,5 @@ CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=n CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=n CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=n CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=n +CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC=n CONFIG_SND_SOC_ICS43432=n \ No newline at end of file diff --git a/root/target/linux/brcm2708/patches-4.14/0300-net-lan78xx-Add-support-for-VLAN-filtering.patch b/root/target/linux/brcm2708/patches-4.14/0300-net-lan78xx-Add-support-for-VLAN-filtering.patch new file mode 100644 index 00000000..e8e0b144 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0300-net-lan78xx-Add-support-for-VLAN-filtering.patch @@ -0,0 +1,41 @@ +From 7a6e7a4c6b944b384d768924d59726e4d6141623 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 10 Apr 2018 12:39:06 +0100 +Subject: [PATCH 300/321] net: lan78xx: Add support for VLAN filtering. + +HW_VLAN_CTAG_FILTER was partially implemented, but not fully to Linux. +Complete the implementation of this. + +See #2458. + +Signed-off-by: Dave Stevenson +--- + drivers/net/usb/lan78xx.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c +index f11cff7664c3..b7b1e2e46dd0 100644 +--- a/drivers/net/usb/lan78xx.c ++++ b/drivers/net/usb/lan78xx.c +@@ -2295,7 +2295,7 @@ static int lan78xx_set_features(struct net_device *netdev, + pdata->rfe_ctl &= ~(RFE_CTL_ICMP_COE_ | RFE_CTL_IGMP_COE_); + } + +- if (features & NETIF_F_HW_VLAN_CTAG_RX) ++ if (features & NETIF_F_HW_VLAN_CTAG_FILTER) + pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_; + else + pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_; +@@ -2909,6 +2909,9 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) + if (DEFAULT_TSO_CSUM_ENABLE) + dev->net->features |= NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG; + ++ if (DEFAULT_VLAN_FILTER_ENABLE) ++ dev->net->features |= NETIF_F_HW_VLAN_CTAG_FILTER; ++ + dev->net->hw_features = dev->net->features; + + ret = lan78xx_setup_irq_domain(dev); +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0301-net-lan78xx-Add-support-for-VLAN-tag-stripping.patch b/root/target/linux/brcm2708/patches-4.14/0301-net-lan78xx-Add-support-for-VLAN-tag-stripping.patch new file mode 100644 index 00000000..a1c79730 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0301-net-lan78xx-Add-support-for-VLAN-tag-stripping.patch @@ -0,0 +1,87 @@ +From 3a3fab31efe58b6730cc094c0f744e22c75ff66f Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 10 Apr 2018 15:27:51 +0100 +Subject: [PATCH 301/321] net: lan78xx: Add support for VLAN tag stripping. + +The chip supports stripping the VLAN tag and reporting it +in metadata. Implement this as it also appears to solve the +issues observed in checksum computation. + +See #2458. + +Signed-off-by: Dave Stevenson +--- + drivers/net/usb/lan78xx.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c +index b7b1e2e46dd0..ebf5dfa98cc0 100644 +--- a/drivers/net/usb/lan78xx.c ++++ b/drivers/net/usb/lan78xx.c +@@ -64,6 +64,7 @@ + #define DEFAULT_RX_CSUM_ENABLE (true) + #define DEFAULT_TSO_CSUM_ENABLE (true) + #define DEFAULT_VLAN_FILTER_ENABLE (true) ++#define DEFAULT_VLAN_RX_OFFLOAD (true) + #define TX_OVERHEAD (8) + #define RXW_PADDING 2 + +@@ -2295,6 +2296,11 @@ static int lan78xx_set_features(struct net_device *netdev, + pdata->rfe_ctl &= ~(RFE_CTL_ICMP_COE_ | RFE_CTL_IGMP_COE_); + } + ++ if (features & NETIF_F_HW_VLAN_CTAG_RX) ++ pdata->rfe_ctl |= RFE_CTL_VLAN_STRIP_; ++ else ++ pdata->rfe_ctl &= ~RFE_CTL_VLAN_STRIP_; ++ + if (features & NETIF_F_HW_VLAN_CTAG_FILTER) + pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_; + else +@@ -2909,6 +2915,9 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) + if (DEFAULT_TSO_CSUM_ENABLE) + dev->net->features |= NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG; + ++ if (DEFAULT_VLAN_RX_OFFLOAD) ++ dev->net->features |= NETIF_F_HW_VLAN_CTAG_RX; ++ + if (DEFAULT_VLAN_FILTER_ENABLE) + dev->net->features |= NETIF_F_HW_VLAN_CTAG_FILTER; + +@@ -2989,6 +2998,16 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev, + } + } + ++static void lan78xx_rx_vlan_offload(struct lan78xx_net *dev, ++ struct sk_buff *skb, ++ u32 rx_cmd_a, u32 rx_cmd_b) ++{ ++ if ((dev->net->features & NETIF_F_HW_VLAN_CTAG_RX) && ++ (rx_cmd_a & RX_CMD_A_FVTG_)) ++ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ++ (rx_cmd_b & 0xffff)); ++} ++ + static void lan78xx_skb_return(struct lan78xx_net *dev, struct sk_buff *skb) + { + int status; +@@ -3053,6 +3072,8 @@ static int lan78xx_rx(struct lan78xx_net *dev, struct sk_buff *skb) + if (skb->len == size) { + lan78xx_rx_csum_offload(dev, skb, + rx_cmd_a, rx_cmd_b); ++ lan78xx_rx_vlan_offload(dev, skb, ++ rx_cmd_a, rx_cmd_b); + + skb_trim(skb, skb->len - 4); /* remove fcs */ + skb->truesize = size + sizeof(struct sk_buff); +@@ -3071,6 +3092,7 @@ static int lan78xx_rx(struct lan78xx_net *dev, struct sk_buff *skb) + skb_set_tail_pointer(skb2, size); + + lan78xx_rx_csum_offload(dev, skb2, rx_cmd_a, rx_cmd_b); ++ lan78xx_rx_vlan_offload(dev, skb2, rx_cmd_a, rx_cmd_b); + + skb_trim(skb2, skb2->len - 4); /* remove fcs */ + skb2->truesize = size + sizeof(struct sk_buff); +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0302-net-lan78xx-Reduce-s-w-csum-check-on-VLANs.patch b/root/target/linux/brcm2708/patches-4.14/0302-net-lan78xx-Reduce-s-w-csum-check-on-VLANs.patch new file mode 100644 index 00000000..2b5cbda6 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0302-net-lan78xx-Reduce-s-w-csum-check-on-VLANs.patch @@ -0,0 +1,40 @@ +From 0a76b56e61cf7745b8012299c8bc72e1a8fd6d05 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 10 Apr 2018 13:08:36 +0100 +Subject: [PATCH 302/321] net: lan78xx: Reduce s/w csum check on VLANs + +With HW_VLAN_CTAG_RX enabled we don't observe the checksum +issue, so amend the workaround to only drop back to s/w +checksums if VLAN offload is disabled. + +See #2458. + +Signed-off-by: Dave Stevenson +--- + drivers/net/usb/lan78xx.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c +index ebf5dfa98cc0..28c47345420a 100644 +--- a/drivers/net/usb/lan78xx.c ++++ b/drivers/net/usb/lan78xx.c +@@ -2985,12 +2985,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev, + struct sk_buff *skb, + u32 rx_cmd_a, u32 rx_cmd_b) + { +- /* Checksum offload appears to be flawed if used with VLANs. +- * Elect for sw checksum check instead. ++ /* HW Checksum offload appears to be flawed if used when not stripping ++ * VLAN headers. + */ + if (!(dev->net->features & NETIF_F_RXCSUM) || + unlikely(rx_cmd_a & RX_CMD_A_ICSM_) || +- (rx_cmd_a & RX_CMD_A_FVTG_)) { ++ ((rx_cmd_a & RX_CMD_A_FVTG_) && ++ !(dev->net->features & NETIF_F_HW_VLAN_CTAG_RX))) { + skb->ip_summed = CHECKSUM_NONE; + } else { + skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_)); +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0303-config-Enable-the-DS1621-I2C-temperature-sensor.patch b/root/target/linux/brcm2708/patches-4.14/0303-config-Enable-the-DS1621-I2C-temperature-sensor.patch new file mode 100644 index 00000000..da95a581 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0303-config-Enable-the-DS1621-I2C-temperature-sensor.patch @@ -0,0 +1,40 @@ +From 435b6e07850c14afb03ab9a55418001c8fdb1c57 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Sun, 15 Apr 2018 10:35:22 +0100 +Subject: [PATCH 303/321] config: Enable the DS1621 I2C temperature sensor + +See: https://github.com/raspberrypi/linux/issues/2509 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index cb348578d44f..deccc426d99b 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -647,6 +647,7 @@ CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m + CONFIG_HWMON=m ++CONFIG_SENSORS_DS1621=m + CONFIG_SENSORS_JC42=m + CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 12f20a105638..e5aae4616caf 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -640,6 +640,7 @@ CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m + CONFIG_HWMON=m ++CONFIG_SENSORS_DS1621=m + CONFIG_SENSORS_JC42=m + CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0304-overlays-Add-ds1621-to-the-i2c-sensor-overlay.patch b/root/target/linux/brcm2708/patches-4.14/0304-overlays-Add-ds1621-to-the-i2c-sensor-overlay.patch new file mode 100644 index 00000000..cf7db5a5 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0304-overlays-Add-ds1621-to-the-i2c-sensor-overlay.patch @@ -0,0 +1,104 @@ +From d3126c92d6bcf88e3325b976c0284e45e0cc85c9 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Sun, 15 Apr 2018 10:36:15 +0100 +Subject: [PATCH 304/321] overlays: Add ds1621 to the i2c-sensor overlay + +The ds1621 enables the Dallas Semiconductors DS1621 temperature +sensor. + +See: https://github.com/raspberrypi/linux/issues/2509 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 15 +++++++++------ + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 19 ++++++++++++++++++- + 2 files changed, 27 insertions(+), 7 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 7ec84713cd06..1ee3e902f76c 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -821,8 +821,8 @@ Name: i2c-sensor + Info: Adds support for a number of I2C barometric pressure and temperature + sensors on i2c_arm + Load: dtoverlay=i2c-sensor,= +-Params: addr Set the address for the BME280, BMP280, TMP102, +- HDC100X, LM75 or SHT3x ++Params: addr Set the address for the BME280, BMP280, DS1621, ++ HDC100X, LM75, SHT3x or TMP102 + + bme280 Select the Bosch Sensortronic BME280 + Valid addresses 0x76-0x77, default 0x76 +@@ -834,6 +834,9 @@ Params: addr Set the address for the BME280, BMP280, TMP102, + bmp280 Select the Bosch Sensortronic BMP280 + Valid addresses 0x76-0x77, default 0x76 + ++ ds1621 Select the Dallas Semiconductors DS1621 temp ++ sensor. Valid addresses 0x48-9x4f, default 0x48 ++ + hdc100x Select the Texas Instruments HDC100x temp sensor + Valid addresses 0x40-0x43, default 0x40 + +@@ -844,6 +847,10 @@ Params: addr Set the address for the BME280, BMP280, TMP102, + + lm75addr Deprecated - use addr parameter instead + ++ sht3x Select the Sensiron SHT3x temperature and ++ humidity sensor. Valid addresses 0x44-0x45, ++ default 0x44 ++ + si7020 Select the Silicon Labs Si7013/20/21 humidity/ + temperature sensor + +@@ -856,10 +863,6 @@ Params: addr Set the address for the BME280, BMP280, TMP102, + veml6070 Select the Vishay VEML6070 ultraviolet light + sensor + +- sht3x Select the Sensiron SHT3x temperature and +- humidity sensor. Valid addresses 0x44-0x45, +- default 0x44 +- + + Name: i2c0-bcm2708 + Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +index 0b9bc8ff9dd2..4b5be8676d11 100644 +--- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -186,9 +186,25 @@ + }; + }; + ++ fragment@12 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ds1621: ds1621@48 { ++ compatible = "ds1621"; ++ reg = <0x48>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ + __overrides__ { + addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0", +- <&lm75>,"reg:0", <&hdc100x>,"reg:0", <&sht3x>,"reg:0"; ++ <&lm75>,"reg:0", <&hdc100x>,"reg:0", <&sht3x>,"reg:0", ++ <&ds1621>,"reg:0"; + bme280 = <0>,"+0"; + bmp085 = <0>,"+1"; + bmp180 = <0>,"+2"; +@@ -202,5 +218,6 @@ + tsl4531 = <0>,"+9"; + veml6070 = <0>,"+10"; + sht3x = <0>,"+11"; ++ ds1621 = <0>,"+12"; + }; + }; +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0306-configs-Add-CONFIG_BCM2835_DEVGPIOMEM-for-aarch64.patch b/root/target/linux/brcm2708/patches-4.14/0306-configs-Add-CONFIG_BCM2835_DEVGPIOMEM-for-aarch64.patch new file mode 100644 index 00000000..da366713 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0306-configs-Add-CONFIG_BCM2835_DEVGPIOMEM-for-aarch64.patch @@ -0,0 +1,269 @@ +From b6a574b3e3170b4dd2f297ba7f4dbc36f759983a Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 17 Apr 2018 09:16:46 +0100 +Subject: [PATCH 306/321] configs: Add CONFIG_BCM2835_DEVGPIOMEM for aarch64 + +See: https://github.com/raspberrypi/linux/issues/2514 + +Signed-off-by: Phil Elwell +--- + arch/arm64/configs/bcmrpi3_defconfig | 73 ++++++++++++++---------------------- + 1 file changed, 28 insertions(+), 45 deletions(-) + +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 69aea2f6da4a..ff5d079c1bbf 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -352,20 +352,6 @@ CONFIG_YAM=m + CONFIG_CAN=m + CONFIG_CAN_VCAN=m + CONFIG_CAN_MCP251X=m +-CONFIG_IRDA=m +-CONFIG_IRLAN=m +-CONFIG_IRNET=m +-CONFIG_IRCOMM=m +-CONFIG_IRDA_ULTRA=y +-CONFIG_IRDA_CACHE_LAST_LSAP=y +-CONFIG_IRDA_FAST_RR=y +-CONFIG_IRTTY_SIR=m +-CONFIG_KINGSUN_DONGLE=m +-CONFIG_KSDAZZLE_DONGLE=m +-CONFIG_KS959_DONGLE=m +-CONFIG_USB_IRDA=m +-CONFIG_SIGMATEL_FIR=m +-CONFIG_MCS_FIR=m + CONFIG_BT=m + CONFIG_BT_RFCOMM=m + CONFIG_BT_RFCOMM_TTY=y +@@ -425,7 +411,6 @@ CONFIG_ISCSI_TCP=m + CONFIG_ISCSI_BOOT_SYSFS=m + CONFIG_MD=y + CONFIG_MD_LINEAR=m +-CONFIG_MD_RAID0=m + CONFIG_BLK_DEV_DM=m + CONFIG_DM_CRYPT=m + CONFIG_DM_SNAPSHOT=m +@@ -445,7 +430,6 @@ CONFIG_NETCONSOLE=m + CONFIG_TUN=m + CONFIG_VETH=m + CONFIG_ENC28J60=m +-CONFIG_QCA7000=m + CONFIG_MDIO_BITBANG=m + CONFIG_PPP=m + CONFIG_PPP_BSDCOMP=m +@@ -466,6 +450,7 @@ CONFIG_USB_KAWETH=m + CONFIG_USB_PEGASUS=m + CONFIG_USB_RTL8150=m + CONFIG_USB_RTL8152=m ++CONFIG_USB_LAN78XX=y + CONFIG_USB_USBNET=y + CONFIG_USB_NET_AX8817X=m + CONFIG_USB_NET_AX88179_178A=m +@@ -479,7 +464,6 @@ CONFIG_USB_NET_SR9700=m + CONFIG_USB_NET_SR9800=m + CONFIG_USB_NET_SMSC75XX=m + CONFIG_USB_NET_SMSC95XX=y +-CONFIG_USB_LAN78XX=y + CONFIG_USB_NET_GL620A=m + CONFIG_USB_NET_NET1080=m + CONFIG_USB_NET_PLUSB=m +@@ -540,7 +524,6 @@ CONFIG_IEEE802154_AT86RF230=m + CONFIG_IEEE802154_MRF24J40=m + CONFIG_IEEE802154_CC2520=m + CONFIG_INPUT_POLLDEV=m +-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set + CONFIG_INPUT_JOYDEV=m + CONFIG_INPUT_EVDEV=m + # CONFIG_KEYBOARD_ATKBD is not set +@@ -578,7 +561,7 @@ CONFIG_GAMEPORT_NS558=m + CONFIG_GAMEPORT_L4=m + CONFIG_BRCM_CHAR_DRIVERS=y + CONFIG_BCM_VCIO=y +-# CONFIG_BCM2835_DEVGPIOMEM is not set ++CONFIG_BCM2835_DEVGPIOMEM=y + # CONFIG_BCM2835_SMI_DEV is not set + # CONFIG_LEGACY_PTYS is not set + CONFIG_SERIAL_8250=y +@@ -617,7 +600,6 @@ CONFIG_GPIO_BCM_EXP=y + CONFIG_GPIO_BCM_VIRT=y + CONFIG_GPIO_ARIZONA=m + CONFIG_GPIO_STMPE=y +-CONFIG_GPIO_MCP23S08=m + CONFIG_W1=m + CONFIG_W1_MASTER_DS2490=m + CONFIG_W1_MASTER_DS2482=m +@@ -635,7 +617,6 @@ CONFIG_W1_SLAVE_DS2760=m + CONFIG_W1_SLAVE_DS2780=m + CONFIG_W1_SLAVE_DS2781=m + CONFIG_W1_SLAVE_DS28E04=m +-CONFIG_W1_SLAVE_BQ27000=m + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m + CONFIG_HWMON=m +@@ -647,19 +628,11 @@ CONFIG_THERMAL=y + CONFIG_BCM2835_THERMAL=y + CONFIG_WATCHDOG=y + CONFIG_BCM2835_WDT=y +-CONFIG_UCB1400_CORE=m + CONFIG_MFD_STMPE=y + CONFIG_STMPE_SPI=y + CONFIG_MFD_ARIZONA_I2C=m + CONFIG_MFD_ARIZONA_SPI=m + CONFIG_MFD_WM5102=y +-CONFIG_MEDIA_SUPPORT=m +-CONFIG_MEDIA_CAMERA_SUPPORT=y +-CONFIG_MEDIA_ANALOG_TV_SUPPORT=y +-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y +-CONFIG_MEDIA_RADIO_SUPPORT=y +-CONFIG_MEDIA_RC_SUPPORT=y +-CONFIG_MEDIA_CONTROLLER=y + CONFIG_LIRC=m + CONFIG_RC_DEVICES=y + CONFIG_RC_ATI_REMOTE=m +@@ -671,6 +644,12 @@ CONFIG_IR_IGUANA=m + CONFIG_IR_TTUSBIR=m + CONFIG_RC_LOOPBACK=m + CONFIG_IR_GPIO_CIR=m ++CONFIG_MEDIA_SUPPORT=m ++CONFIG_MEDIA_CAMERA_SUPPORT=y ++CONFIG_MEDIA_ANALOG_TV_SUPPORT=y ++CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y ++CONFIG_MEDIA_RADIO_SUPPORT=y ++CONFIG_MEDIA_CONTROLLER=y + CONFIG_MEDIA_USB_SUPPORT=y + CONFIG_USB_VIDEO_CLASS=m + CONFIG_USB_M5602=m +@@ -731,7 +710,6 @@ CONFIG_VIDEO_PVRUSB2=m + CONFIG_VIDEO_HDPVR=m + CONFIG_VIDEO_USBVISION=m + CONFIG_VIDEO_STK1160_COMMON=m +-CONFIG_VIDEO_STK1160_AC97=y + CONFIG_VIDEO_GO7007=m + CONFIG_VIDEO_GO7007_USB=m + CONFIG_VIDEO_GO7007_USB_S2250_BOARD=m +@@ -817,9 +795,9 @@ CONFIG_VIDEO_OV7640=m + CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m + CONFIG_DRM_LOAD_EDID_FIRMWARE=y ++CONFIG_DRM_UDL=m + CONFIG_DRM_PANEL_SIMPLE=m + CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m +-CONFIG_DRM_UDL=m + CONFIG_DRM_VC4=m + CONFIG_FB=y + CONFIG_FB_BCM2708=y +@@ -835,19 +813,15 @@ CONFIG_LOGO=y + # CONFIG_LOGO_LINUX_VGA16 is not set + CONFIG_SOUND=y + CONFIG_SND=m ++CONFIG_SND_HRTIMER=m + CONFIG_SND_SEQUENCER=m + CONFIG_SND_SEQ_DUMMY=m +-CONFIG_SND_MIXER_OSS=m +-CONFIG_SND_PCM_OSS=m +-CONFIG_SND_SEQUENCER_OSS=y +-CONFIG_SND_HRTIMER=m + CONFIG_SND_DUMMY=m + CONFIG_SND_ALOOP=m + CONFIG_SND_VIRMIDI=m + CONFIG_SND_MTPAV=m + CONFIG_SND_SERIAL_U16550=m + CONFIG_SND_MPU401=m +-CONFIG_SND_BCM2835=m + CONFIG_SND_USB_AUDIO=m + CONFIG_SND_USB_UA101=m + CONFIG_SND_USB_CAIAQ=m +@@ -876,7 +850,6 @@ CONFIG_SND_SOC_AK4554=m + CONFIG_SND_SOC_CS4271_I2C=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m +-CONFIG_SOUND_PRIME=m + CONFIG_HIDRAW=y + CONFIG_UHID=m + CONFIG_HID_A4TECH=m +@@ -1032,12 +1005,14 @@ CONFIG_USB_UEAGLEATM=m + CONFIG_USB_XUSBATM=m + CONFIG_MMC=y + CONFIG_MMC_BLOCK_MINORS=32 +-CONFIG_MMC_BCM2835=y ++CONFIG_MMC_BCM2835_MMC=y + CONFIG_MMC_BCM2835_DMA=y + CONFIG_MMC_BCM2835_SDHOST=y + CONFIG_MMC_SDHCI=y + CONFIG_MMC_SDHCI_PLTFM=y ++CONFIG_MMC_SDHCI_IPROC=m + CONFIG_MMC_SPI=m ++CONFIG_MMC_BCM2835=y + CONFIG_LEDS_CLASS=y + CONFIG_LEDS_GPIO=y + CONFIG_LEDS_TRIGGER_TIMER=y +@@ -1091,6 +1066,20 @@ CONFIG_DMA_BCM2708=y + CONFIG_UIO=m + CONFIG_UIO_PDRV_GENIRQ=m + CONFIG_STAGING=y ++CONFIG_IRDA=m ++CONFIG_IRLAN=m ++CONFIG_IRNET=m ++CONFIG_IRCOMM=m ++CONFIG_IRDA_ULTRA=y ++CONFIG_IRDA_CACHE_LAST_LSAP=y ++CONFIG_IRDA_FAST_RR=y ++CONFIG_IRTTY_SIR=m ++CONFIG_KINGSUN_DONGLE=m ++CONFIG_KSDAZZLE_DONGLE=m ++CONFIG_KS959_DONGLE=m ++CONFIG_USB_IRDA=m ++CONFIG_SIGMATEL_FIR=m ++CONFIG_MCS_FIR=m + CONFIG_PRISM2_USB=m + CONFIG_R8712U=m + CONFIG_R8188EU=m +@@ -1099,9 +1088,7 @@ CONFIG_SPEAKUP=m + CONFIG_SPEAKUP_SYNTH_SOFT=m + CONFIG_STAGING_MEDIA=y + CONFIG_LIRC_STAGING=y +-CONFIG_LIRC_IMON=m + CONFIG_LIRC_RPI=m +-CONFIG_LIRC_SASEM=m + CONFIG_FB_TFT=m + CONFIG_FB_TFT_AGM1264K_FL=m + CONFIG_FB_TFT_BD663474=m +@@ -1132,6 +1119,7 @@ CONFIG_FB_TFT_UPD161704=m + CONFIG_FB_TFT_WATTEROTT=m + CONFIG_FB_FLEX=m + CONFIG_FB_TFT_FBTFT_DEVICE=m ++CONFIG_SND_BCM2835=m + CONFIG_MAILBOX=y + CONFIG_BCM2835_MBOX=y + # CONFIG_IOMMU_SUPPORT is not set +@@ -1218,7 +1206,6 @@ CONFIG_CIFS_XATTR=y + CONFIG_CIFS_POSIX=y + CONFIG_CIFS_ACL=y + CONFIG_CIFS_DFS_UPCALL=y +-CONFIG_CIFS_SMB2=y + CONFIG_CIFS_FSCACHE=y + CONFIG_9P_FS=m + CONFIG_9P_FS_POSIX_ACL=y +@@ -1265,13 +1252,11 @@ CONFIG_PRINTK_TIME=y + CONFIG_BOOT_PRINTK_DELAY=y + CONFIG_DEBUG_MEMORY_INIT=y + CONFIG_DETECT_HUNG_TASK=y +-CONFIG_TIMER_STATS=y + CONFIG_LATENCYTOP=y + CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_STACK_TRACER=y + CONFIG_BLK_DEV_IO_TRACE=y +-# CONFIG_KPROBE_EVENT is not set + CONFIG_FUNCTION_PROFILER=y + CONFIG_KGDB=y + CONFIG_KGDB_KDB=y +@@ -1289,5 +1274,3 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m + CONFIG_ARM64_CRYPTO=y + CONFIG_CRC_ITU_T=y + CONFIG_LIBCRC32C=y +-CONFIG_MMC_BCM2835_MMC=y +-CONFIG_MMC_SDHCI_IPROC=m +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0307-overlays-Add-combine-option-to-i2c-overlays.patch b/root/target/linux/brcm2708/patches-4.14/0307-overlays-Add-combine-option-to-i2c-overlays.patch new file mode 100644 index 00000000..5d9e60a2 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0307-overlays-Add-combine-option-to-i2c-overlays.patch @@ -0,0 +1,113 @@ +From 2a9ef94eda9f59280c7259b3b5ece8993605165e Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 18 Apr 2018 17:04:23 +0100 +Subject: [PATCH 307/321] overlays: Add 'combine' option to i2c overlays + +The i2c0-bcm2708 and i2c1-bcm2708 overlays allow the I2C pin usage to +be changed. The names also suggest they revert to the old i2c_bcm2708 +driver, but they don't. The newer i2c_bcm2835 driver forces +transactions to be combined where possible, but this breaks some +devices. + +Add an option to disable transaction combining, which is currently +implemented by reverting to the old driver. + +See: https://github.com/raspberrypi/firmware/issues/828 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 12 ++++++++++-- + arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts | 8 ++++++++ + arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts | 9 +++++++++ + 3 files changed, 27 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 57cba15cfa40..ca6995142322 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -865,8 +865,9 @@ Params: addr Set the address for the BME280, BMP280, DS1621, + + + Name: i2c0-bcm2708 +-Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations +- are usable on all platforms. ++Info: Change i2c0 pin usage. Not all pin combinations are usable on all ++ platforms - platforms other then Compute Modules can only use this ++ to disable transaction combining. + Load: dtoverlay=i2c0-bcm2708,= + Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*) + scl0_pin GPIO pin for SCL0 (deprecated - use pins_*) +@@ -874,15 +875,22 @@ Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*) + pins_28_29 Use pins 28 and 29 + pins_44_45 Use pins 44 and 45 + pins_46_47 Use pins 46 and 47 ++ combine Allow transactions to be combined (default ++ "yes") + + + Name: i2c1-bcm2708 ++Info: Change i2c1 pin usage. Not all pin combinations are usable on all ++ platforms - platforms other then Compute Modules can only use this ++ to disable transaction combining. + Info: Enable the i2c_bcm2708 driver for the i2c1 bus + Load: dtoverlay=i2c1-bcm2708,= + Params: sda1_pin GPIO pin for SDA1 (2 or 44 - default 2) + scl1_pin GPIO pin for SCL1 (3 or 45 - default 3) + pin_func Alternative pin function (4 (alt0), 6 (alt2) - + default 4) ++ combine Allow transactions to be combined (default ++ "yes") + + + Name: i2s-gpio28-31 +diff --git a/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts b/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts +index 1f4fc7b57060..9b5776f1bf6a 100644 +--- a/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts +@@ -50,6 +50,13 @@ + }; + }; + ++ fragment@5 { ++ target = <&i2c0>; ++ __dormant__ { ++ compatible = "brcm,bcm2708-i2c"; ++ }; ++ }; ++ + __overrides__ { + sda0_pin = <&frag1>,"brcm,pins:0"; + scl0_pin = <&frag1>,"brcm,pins:4"; +@@ -57,5 +64,6 @@ + pins_28_29 = <0>,"-1+2-3-4"; + pins_44_45 = <0>,"-1-2+3-4"; + pins_46_47 = <0>,"-1-2-3+4"; ++ combine = <0>, "!5"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts b/arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts +index 7c69047bcd88..c9da3eea0012 100644 +--- a/arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts +@@ -26,9 +26,18 @@ + brcm,function = <4>; /* alt 0 */ + }; + }; ++ ++ fragment@2 { ++ target = <&i2c1>; ++ __dormant__ { ++ compatible = "brcm,bcm2708-i2c"; ++ }; ++ }; ++ + __overrides__ { + sda1_pin = <&pins>,"brcm,pins:0"; + scl1_pin = <&pins>,"brcm,pins:4"; + pin_func = <&pins>,"brcm,function:0"; ++ combine = <0>, "!2"; + }; + }; +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0308-Prevent-voltage-low-warnings-from-filling-log.patch b/root/target/linux/brcm2708/patches-4.14/0308-Prevent-voltage-low-warnings-from-filling-log.patch new file mode 100644 index 00000000..4254251c --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0308-Prevent-voltage-low-warnings-from-filling-log.patch @@ -0,0 +1,78 @@ +From d2cf662756932ca61f61b9552272bb36cde5e966 Mon Sep 17 00:00:00 2001 +From: James Hughes +Date: Wed, 18 Apr 2018 13:02:57 +0100 +Subject: [PATCH 308/321] Prevent voltage low warnings from filling log + +Although the correct fix for low voltage warnings is to +improve the power supply, the current implementation +of the detection can fill the log if the warning +happens freqently. This replaces the logging with +slightly custom ratelimited logging. + +Signed-off-by: James Hughes +--- + drivers/firmware/raspberrypi.c | 40 ++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 38 insertions(+), 2 deletions(-) + +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +index d0d36c17f4fc..3c96a27734b6 100644 +--- a/drivers/firmware/raspberrypi.c ++++ b/drivers/firmware/raspberrypi.c +@@ -24,6 +24,38 @@ + + #define UNDERVOLTAGE_BIT BIT(0) + ++ ++/* ++ * This section defines some rate limited logging that prevent ++ * repeated messages at much lower Hz than the default kernel settings. ++ * It's usually 5s, this is 5 minutes. ++ * Burst 3 means you may get three messages 'quickly', before ++ * the ratelimiting kicks in. ++ */ ++#define LOCAL_RATELIMIT_INTERVAL (5 * 60 * HZ) ++#define LOCAL_RATELIMIT_BURST 3 ++ ++#ifdef CONFIG_PRINTK ++#define printk_ratelimited_local(fmt, ...) \ ++({ \ ++ static DEFINE_RATELIMIT_STATE(_rs, \ ++ LOCAL_RATELIMIT_INTERVAL, \ ++ LOCAL_RATELIMIT_BURST); \ ++ \ ++ if (__ratelimit(&_rs)) \ ++ printk(fmt, ##__VA_ARGS__); \ ++}) ++#else ++#define printk_ratelimited_local(fmt, ...) \ ++ no_printk(fmt, ##__VA_ARGS__) ++#endif ++ ++#define pr_crit_ratelimited_local(fmt, ...) \ ++ printk_ratelimited_local(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) ++#define pr_info_ratelimited_local(fmt, ...) \ ++ printk_ratelimited_local(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) ++ ++ + struct rpi_firmware { + struct mbox_client cl; + struct mbox_chan *chan; /* The property channel. */ +@@ -216,9 +248,13 @@ static int rpi_firmware_get_throttled(struct rpi_firmware *fw, u32 *value) + + if (new_uv != old_uv) { + if (new_uv) +- pr_crit("Under-voltage detected! (0x%08x)\n", *value); ++ pr_crit_ratelimited_local( ++ "Under-voltage detected! (0x%08x)\n", ++ *value); + else +- pr_info("Voltage normalised (0x%08x)\n", *value); ++ pr_info_ratelimited_local( ++ "Voltage normalised (0x%08x)\n", ++ *value); + } + + sysfs_notify(&fw->cl.dev->kobj, NULL, "get_throttled"); +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0309-BCM270X_DT-Add-sdio_overclock-parameter.patch b/root/target/linux/brcm2708/patches-4.14/0309-BCM270X_DT-Add-sdio_overclock-parameter.patch new file mode 100644 index 00000000..c814e4fe --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0309-BCM270X_DT-Add-sdio_overclock-parameter.patch @@ -0,0 +1,45 @@ +From 2d71f6ea0843af1e218113ac8309b3966fcffc27 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 24 Apr 2018 14:28:33 +0100 +Subject: [PATCH 309/321] BCM270X_DT: Add sdio_overclock parameter + +The Arasan MMC interface is used on some RPis to drive the SDIO +link to the WiFi controller. The downstream bcm2835-mmc driver, +like the bcm2835-sdhost driver, can be over- (or under-) clocked. +Add a common parameter - sdio_overclock - to all DTBs to control it. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm2708-rpi.dtsi | 1 + + arch/arm/boot/dts/overlays/README | 3 +++ + 2 files changed, 4 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi.dtsi b/arch/arm/boot/dts/bcm2708-rpi.dtsi +index d105d4e208f2..fe2694a1cbdc 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi.dtsi +@@ -115,6 +115,7 @@ + sd_force_pio = <&sdhost>,"brcm,force-pio?"; + sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; + sd_debug = <&sdhost>,"brcm,debug"; ++ sdio_overclock = <&mmc>,"brcm,overclock-50:0"; + axiperf = <&axiperf>,"status"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index ca6995142322..81e61c0d6bc2 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -139,6 +139,9 @@ Params: + + sd_debug Enable debug output from SD driver (default off) + ++ sdio_overclock Clock (in MHz) to use when the MMC framework ++ requests 50MHz for the SDIO/WiFi interface. ++ + tx_lpi_timer Set the delay in microseconds between going idle + and entering the low power state (default 600). + Requires EEE to be enabled - see "eee". +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0310-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch b/root/target/linux/brcm2708/patches-4.14/0310-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch new file mode 100644 index 00000000..308bda46 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0310-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch @@ -0,0 +1,51 @@ +From aad95bfcafb581fe09321951cd28660ebe6dfd46 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 24 Apr 2018 14:42:27 +0100 +Subject: [PATCH 310/321] gpiolib: Don't prevent IRQ usage of output GPIOs + +Upstream Linux deems using output GPIOs to generate IRQs as a bogus +use case, even though the BCM2835 GPIO controller is capable of doing +so. A number of users would like to make use of this facility, so +disable the checks. + +See: https://github.com/raspberrypi/linux/issues/2527 + +Signed-off-by: Phil Elwell +--- + drivers/gpio/gpiolib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c +index b4c8b25453a6..c22ff5654d22 100644 +--- a/drivers/gpio/gpiolib.c ++++ b/drivers/gpio/gpiolib.c +@@ -53,6 +53,8 @@ + #define extra_checks 0 + #endif + ++#define dont_test_bit(b,d) (0) ++ + /* Device and char device-related information */ + static DEFINE_IDA(gpio_ida); + static dev_t gpio_devt; +@@ -2301,7 +2303,7 @@ static int _gpiod_direction_output_raw(struct gpio_desc *desc, int value) + int ret; + + /* GPIOs used for IRQs shall not be set as output */ +- if (test_bit(FLAG_USED_AS_IRQ, &desc->flags)) { ++ if (dont_test_bit(FLAG_USED_AS_IRQ, &desc->flags)) { + gpiod_err(desc, + "%s: tried to set a GPIO tied to an IRQ as output\n", + __func__); +@@ -2816,7 +2818,7 @@ int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset) + set_bit(FLAG_IS_OUT, &desc->flags); + } + +- if (test_bit(FLAG_IS_OUT, &desc->flags)) { ++ if (dont_test_bit(FLAG_IS_OUT, &desc->flags)) { + chip_err(chip, + "%s: tried to flag a GPIO set as output for IRQ\n", + __func__); +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0311-Drivers-for-Allo-Katana-DAC.patch b/root/target/linux/brcm2708/patches-4.14/0311-Drivers-for-Allo-Katana-DAC.patch new file mode 100644 index 00000000..b0952f4c --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0311-Drivers-for-Allo-Katana-DAC.patch @@ -0,0 +1,779 @@ +From f2722a1bd2a098e345bc1401162b0c5217040c19 Mon Sep 17 00:00:00 2001 +From: allocom +Date: Thu, 19 Apr 2018 12:12:26 +0530 +Subject: [PATCH 311/321] Drivers for Allo Katana DAC + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../dts/overlays/allo-katana-dac-audio-overlay.dts | 46 ++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/allo-katana-dac.c | 105 ++++++++ + sound/soc/codecs/Kconfig | 10 + + sound/soc/codecs/Makefile | 4 + + sound/soc/codecs/sabre-ess-i2c.c | 69 +++++ + sound/soc/codecs/sabre-ess.c | 300 +++++++++++++++++++++ + sound/soc/codecs/sabre-ess.h | 62 +++++ + 13 files changed, 614 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts + create mode 100644 sound/soc/bcm/allo-katana-dac.c + create mode 100644 sound/soc/codecs/sabre-ess-i2c.c + create mode 100644 sound/soc/codecs/sabre-ess.c + create mode 100644 sound/soc/codecs/sabre-ess.h + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 5439afd9b28c..18cb057ce127 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -9,6 +9,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + akkordion-iqdacplus.dtbo \ + allo-boss-dac-pcm512x-audio.dtbo \ + allo-digione.dtbo \ ++ allo-katana-dac-audio.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ + allo-piano-dac-plus-pcm512x-audio.dtbo \ + applepi-dac.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 81e61c0d6bc2..889c487dcdc3 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -317,6 +317,12 @@ Load: dtoverlay=allo-digione + Params: + + ++Name: allo-katana ++Info: Configures the Allo Katana audio card ++Load: dtoverlay=allo-katana-dac-audio ++Params: ++ ++ + Name: allo-piano-dac-pcm512x-audio + Info: Configures the Allo Piano DAC (2.0/2.1) audio cards. + (NB. This initial support is for 2.0 channel audio ONLY! ie. stereo. +diff --git a/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts +new file mode 100644 +index 000000000000..d41ae92e0a5c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts +@@ -0,0 +1,46 @@ ++/* ++ * Definitions for Allo Katana DAC boards ++ * ++ * NB. The Katana DAC board contains SABER DAC. ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ sabre-ess@30 { ++ #sound-dai-cells = <0>; ++ compatible = "saber,sabre-ess"; ++ reg = <0x30>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ katana_dac: __overlay__ { ++ compatible = "allo,katana-dac"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++ ++}; ++ +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index deccc426d99b..2f902b65509f 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -894,6 +894,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m ++CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index e5aae4616caf..d92421ab31e6 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -887,6 +887,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m ++CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index e601eb0bfaba..a264f78388c2 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -175,6 +175,13 @@ config SND_BCM2708_SOC_ALLO_DIGIONE + help + Say Y or M if you want to add support for Allo DigiOne. + ++config SND_BCM2708_SOC_ALLO_KATANA_DAC ++ tristate "Support for Allo Katana DAC" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_SABRE_ESS_I2C ++ help ++ Say Y or M if you want to add support for Allo Katana DAC. ++ + config SND_BCM2708_SOC_FE_PI_AUDIO + tristate "Support for Fe-Pi-Audio" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 2b99630f5dec..2f99a8360a6a 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -34,6 +34,7 @@ snd-soc-allo-boss-dac-objs := allo-boss-dac.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o + snd-soc-allo-digione-objs := allo-digione.o ++snd-soc-allo-katana-dac-objs := allo-katana-dac.o + snd-soc-pisound-objs := pisound.o + snd-soc-fe-pi-audio-objs := fe-pi-audio.o + +@@ -60,5 +61,6 @@ obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE) += snd-soc-allo-digione.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC) += snd-soc-allo-katana-dac.o + obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o + obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o +diff --git a/sound/soc/bcm/allo-katana-dac.c b/sound/soc/bcm/allo-katana-dac.c +new file mode 100644 +index 000000000000..2192df027ac8 +--- /dev/null ++++ b/sound/soc/bcm/allo-katana-dac.c +@@ -0,0 +1,105 @@ ++/* ++ * ASoC Driver for KATANA DAC ++ * ++ * Author: Jaikumar ++ * Copyright 2018 ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++static struct snd_soc_dai_link snd_allo_katana_dac_dai[] = { ++{ ++ .name = "KATANA DAC", ++ //.stream_name = "KATANA DAC HiFi [Master]", ++ .stream_name = "KATANA DAC", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ //.codec_dai_name = "es9038q2m-hifi", ++ .codec_dai_name = "sabre-ess", ++ .platform_name = "bcm2708-i2s.0", ++ //.codec_name = "es9038q2m.1-0030", ++ .codec_name = "sabre-ess.1-0030", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBM_CFM, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_allo_katana_dac = { ++ .name = "snd_allo_katana_dac", ++ .owner = THIS_MODULE, ++ .dai_link = snd_allo_katana_dac_dai, ++ .num_links = ARRAY_SIZE(snd_allo_katana_dac_dai), ++}; ++ ++static int snd_allo_katana_dac_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_allo_katana_dac.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_allo_katana_dac_dai[0]; ++ ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ ++ ret = snd_soc_register_card(&snd_allo_katana_dac); ++ if (ret && ret != -EPROBE_DEFER) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ++ ret); ++ ++ return ret; ++} ++ ++static int snd_allo_katana_dac_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_allo_katana_dac); ++} ++ ++static const struct of_device_id snd_allo_katana_dac_of_match[] = { ++ { .compatible = "allo,katana-dac", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, snd_allo_katana_dac_of_match); ++ ++static struct platform_driver snd_allo_katana_dac_driver = { ++ .driver = { ++ .name = "snd-katana-dac", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_allo_katana_dac_of_match, ++ }, ++ .probe = snd_allo_katana_dac_probe, ++ .remove = snd_allo_katana_dac_remove, ++}; ++ ++module_platform_driver(snd_allo_katana_dac_driver); ++ ++MODULE_AUTHOR("Jaikumar "); ++MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Katana DAC"); ++MODULE_LICENSE("GPL v2"); ++ +diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig +index b3c63d86e5ef..b52aab582303 100644 +--- a/sound/soc/codecs/Kconfig ++++ b/sound/soc/codecs/Kconfig +@@ -77,6 +77,7 @@ config SND_SOC_ALL_CODECS + select SND_SOC_ES8328_SPI if SPI_MASTER + select SND_SOC_ES8328_I2C if I2C + select SND_SOC_ES7134 ++ select SND_SOC_SABRE_ESS_I2C if I2C + select SND_SOC_GTM601 + select SND_SOC_HDAC_HDMI + select SND_SOC_ICS43432 +@@ -1186,4 +1187,13 @@ config SND_SOC_TPA6130A2 + tristate "Texas Instruments TPA6130A2 headphone amplifier" + depends on I2C + ++config SND_SOC_SABRE_ESS ++ tristate ++ ++config SND_SOC_SABRE_ESS_I2C ++ tristate "Sabre SABRE ESS CODEC - I2C" ++ depends on I2C ++ select SND_SOC_SABRE_ESS ++ select REGMAP_I2C ++ + endmenu +diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile +index f910415bdd31..6e90e1f7d531 100644 +--- a/sound/soc/codecs/Makefile ++++ b/sound/soc/codecs/Makefile +@@ -71,6 +71,8 @@ snd-soc-es8316-objs := es8316.o + snd-soc-es8328-objs := es8328.o + snd-soc-es8328-i2c-objs := es8328-i2c.o + snd-soc-es8328-spi-objs := es8328-spi.o ++snd-soc-sabre-ess-objs := sabre-ess.o ++snd-soc-sabre-ess-i2c-objs := sabre-ess-i2c.o + snd-soc-gtm601-objs := gtm601.o + snd-soc-hdac-hdmi-objs := hdac_hdmi.o + snd-soc-ics43432-objs := ics43432.o +@@ -313,6 +315,8 @@ obj-$(CONFIG_SND_SOC_ES8316) += snd-soc-es8316.o + obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o + obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o + obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o ++obj-$(CONFIG_SND_SOC_SABRE_ESS) += snd-soc-sabre-ess.o ++obj-$(CONFIG_SND_SOC_SABRE_ESS_I2C) += snd-soc-sabre-ess-i2c.o + obj-$(CONFIG_SND_SOC_GTM601) += snd-soc-gtm601.o + obj-$(CONFIG_SND_SOC_HDAC_HDMI) += snd-soc-hdac-hdmi.o + obj-$(CONFIG_SND_SOC_ICS43432) += snd-soc-ics43432.o +diff --git a/sound/soc/codecs/sabre-ess-i2c.c b/sound/soc/codecs/sabre-ess-i2c.c +new file mode 100644 +index 000000000000..a1ecae6edc0b +--- /dev/null ++++ b/sound/soc/codecs/sabre-ess-i2c.c +@@ -0,0 +1,69 @@ ++/* ++ * Driver for the SABRE ESS CODECs ++ * ++ * Author: Jaikumar ++ * Copyright 2018 ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++ ++#include "sabre-ess.h" ++ ++static int sabre_ess_i2c_probe(struct i2c_client *i2c, ++ const struct i2c_device_id *id) ++{ ++ struct regmap *regmap; ++ struct regmap_config config = sabre_ess_regmap; ++ ++ regmap = devm_regmap_init_i2c(i2c, &config); ++ if (IS_ERR(regmap)) ++ return PTR_ERR(regmap); ++ ++ return sabre_ess_probe(&i2c->dev, regmap); ++} ++ ++static int sabre_ess_i2c_remove(struct i2c_client *i2c) ++{ ++ sabre_ess_remove(&i2c->dev); ++ return 0; ++} ++ ++static const struct i2c_device_id sabre_ess_i2c_id[] = { ++ { "sabre-ess", }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, sabre_ess_i2c_id); ++ ++static const struct of_device_id sabre_ess_of_match[] = { ++ { .compatible = "saber,sabre-ess", }, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, sabre_ess_of_match); ++ ++static struct i2c_driver sabre_ess_i2c_driver = { ++ .probe = sabre_ess_i2c_probe, ++ .remove = sabre_ess_i2c_remove, ++ .id_table = sabre_ess_i2c_id, ++ .driver = { ++ .name = "sabre-ess", ++ .of_match_table = sabre_ess_of_match, ++ }, ++}; ++ ++module_i2c_driver(sabre_ess_i2c_driver); ++ ++MODULE_DESCRIPTION("ASoC SABRE ESS codec driver - I2C"); ++MODULE_AUTHOR("Jaikumar "); ++MODULE_LICENSE("GPL v2"); ++ +diff --git a/sound/soc/codecs/sabre-ess.c b/sound/soc/codecs/sabre-ess.c +new file mode 100644 +index 000000000000..bf8ec949fc28 +--- /dev/null ++++ b/sound/soc/codecs/sabre-ess.c +@@ -0,0 +1,300 @@ ++/* ++ * Driver for the SABRE ESS CODEC ++ * ++ * Author: Jaikumar ++ * Copyright 2018 ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "sabre-ess.h" ++ ++struct sabre_ess_priv { ++ struct regmap *regmap; ++ int fmt; ++}; ++ ++static const struct reg_default sabre_ess_reg_defaults[] = { ++ { SABRE_ESS_RESET, 0x00 }, ++ { SABRE_ESS_VOLUME_1, 0xF0 }, ++ { SABRE_ESS_VOLUME_2, 0xF0 }, ++ { SABRE_ESS_MUTE, 0x00 }, ++ { SABRE_ESS_DSP_PROGRAM, 0x04 }, ++ { SABRE_ESS_DEEMPHASIS, 0x00 }, ++ { SABRE_ESS_DOP, 0x01 }, ++ { SABRE_ESS_FORMAT, 0xb4 }, ++}; ++ ++static const char * const sabre_ess_dsp_program_texts[] = { ++ "Linear Phase Fast Roll-off Filter", ++ "Linear Phase Slow Roll-off Filter", ++ "Minimum Phase Fast Roll-off Filter", ++ "Minimum Phase Slow Roll-off Filter", ++ "Apodizing Fast Roll-off Filter", ++ "Corrected Minimum Phase Fast Roll-off Filter", ++ "Brick Wall Filter", ++}; ++ ++static const unsigned int sabre_ess_dsp_program_values[] = { ++ 0, ++ 1, ++ 2, ++ 3, ++ 4, ++ 6, ++ 7, ++}; ++ ++static SOC_VALUE_ENUM_SINGLE_DECL(sabre_ess_dsp_program, ++ SABRE_ESS_DSP_PROGRAM, 0, 0x07, ++ sabre_ess_dsp_program_texts, ++ sabre_ess_dsp_program_values); ++ ++static const char * const sabre_ess_deemphasis_texts[] = { ++ "Bypass", ++ "32kHz", ++ "44.1kHz", ++ "48kHz", ++}; ++ ++static const unsigned int sabre_ess_deemphasis_values[] = { ++ 0, ++ 1, ++ 2, ++ 3, ++}; ++ ++static SOC_VALUE_ENUM_SINGLE_DECL(sabre_ess_deemphasis, ++ SABRE_ESS_DEEMPHASIS, 0, 0x03, ++ sabre_ess_deemphasis_texts, ++ sabre_ess_deemphasis_values); ++ ++static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(master_tlv, -12700, 0); ++ ++static const struct snd_kcontrol_new sabre_ess_controls[] = { ++ SOC_DOUBLE_R_TLV("Master Playback Volume", SABRE_ESS_VOLUME_1, ++ SABRE_ESS_VOLUME_2, 0, 255, 1, master_tlv), ++ SOC_DOUBLE("Master Playback Switch", SABRE_ESS_MUTE, 0, 0, 1, 1), ++ SOC_ENUM("DSP Program Route", sabre_ess_dsp_program), ++ SOC_ENUM("Deemphasis Route", sabre_ess_deemphasis), ++ SOC_SINGLE("DoP Playback Switch", SABRE_ESS_DOP, 0, 1, 1) ++}; ++ ++static bool sabre_ess_readable_register(struct device *dev, unsigned int reg) ++{ ++ switch (reg) { ++ case SABRE_ESS_CHIP_ID_REG: ++ return true; ++ default: ++ return reg < 0xff; ++ } ++} ++ ++static int sabre_ess_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params, ++ struct snd_soc_dai *dai) ++{ ++ struct snd_soc_codec *codec = dai->codec; ++ struct sabre_ess_priv *sabre_ess = snd_soc_codec_get_drvdata(codec); ++ int fmt = 0; ++ int ret; ++ ++ dev_dbg(codec->dev, "hw_params %u Hz, %u channels\n", ++ params_rate(params), ++ params_channels(params)); ++ ++ switch (sabre_ess->fmt & SND_SOC_DAIFMT_MASTER_MASK) { ++ case SND_SOC_DAIFMT_CBM_CFM: // master ++ if (params_channels(params) == 2) ++ fmt = SABRE_ESS_CHAN_STEREO; ++ else ++ fmt = SABRE_ESS_CHAN_MONO; ++ ++ switch (params_width(params)) { ++ case 16: ++ fmt |= SABRE_ESS_ALEN_16; ++ break; ++ case 24: ++ fmt |= SABRE_ESS_ALEN_24; ++ break; ++ case 32: ++ fmt |= SABRE_ESS_ALEN_32; ++ break; ++ default: ++ dev_err(codec->dev, "Bad frame size: %d\n", ++ params_width(params)); ++ return -EINVAL; ++ } ++ ++ switch (params_rate(params)) { ++ case 44100: ++ fmt |= SABRE_ESS_RATE_44100; ++ break; ++ case 48000: ++ fmt |= SABRE_ESS_RATE_48000; ++ break; ++ case 88200: ++ fmt |= SABRE_ESS_RATE_88200; ++ break; ++ case 96000: ++ fmt |= SABRE_ESS_RATE_96000; ++ break; ++ case 176400: ++ fmt |= SABRE_ESS_RATE_176400; ++ break; ++ case 192000: ++ fmt |= SABRE_ESS_RATE_192000; ++ break; ++ case 352800: ++ fmt |= SABRE_ESS_RATE_352800; ++ break; ++ case 384000: ++ fmt |= SABRE_ESS_RATE_384000; ++ break; ++ default: ++ dev_err(codec->dev, "Bad sample rate: %d\n", ++ params_rate(params)); ++ return -EINVAL; ++ } ++ ++ ret = regmap_write(sabre_ess->regmap, SABRE_ESS_FORMAT, fmt); ++ if (ret != 0) { ++ dev_err(codec->dev, "Failed to set format: %d\n", ret); ++ return ret; ++ } ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++static int sabre_ess_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ++{ ++ struct snd_soc_codec *codec = dai->codec; ++ struct sabre_ess_priv *sabre_ess = snd_soc_codec_get_drvdata(codec); ++ ++ sabre_ess->fmt = fmt; ++ ++ return 0; ++} ++ ++static const struct snd_soc_dai_ops sabre_ess_dai_ops = { ++ .hw_params = sabre_ess_hw_params, ++ .set_fmt = sabre_ess_set_fmt, ++}; ++ ++static struct snd_soc_dai_driver sabre_ess_dai = { ++ .name = "sabre-ess", ++ .playback = { ++ .stream_name = "Playback", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = SNDRV_PCM_RATE_CONTINUOUS, ++ .rate_min = 44100, ++ .rate_max = 384000, ++ .formats = SNDRV_PCM_FMTBIT_S16_LE | ++ SNDRV_PCM_FMTBIT_S32_LE ++ }, ++ .ops = &sabre_ess_dai_ops, ++}; ++ ++static struct snd_soc_codec_driver sabre_ess_codec_driver = { ++ .idle_bias_off = false, ++ ++ .component_driver = { ++ .controls = sabre_ess_controls, ++ .num_controls = ARRAY_SIZE(sabre_ess_controls), ++ }, ++}; ++ ++static const struct regmap_range_cfg sabre_ess_range = { ++ .name = "Pages", .range_min = SABRE_ESS_VIRT_BASE, ++ .range_max = SABRE_ESS_MAX_REGISTER, ++ .selector_reg = SABRE_ESS_PAGE, ++ .selector_mask = 0xff, ++ .window_start = 0, .window_len = 0x100, ++}; ++ ++const struct regmap_config sabre_ess_regmap = { ++ .reg_bits = 8, ++ .val_bits = 8, ++ ++ .ranges = &sabre_ess_range, ++ .num_ranges = 1, ++ ++ .max_register = SABRE_ESS_MAX_REGISTER, ++ .readable_reg = sabre_ess_readable_register, ++ .reg_defaults = sabre_ess_reg_defaults, ++ .num_reg_defaults = ARRAY_SIZE(sabre_ess_reg_defaults), ++ .cache_type = REGCACHE_RBTREE, ++}; ++EXPORT_SYMBOL_GPL(sabre_ess_regmap); ++ ++int sabre_ess_probe(struct device *dev, struct regmap *regmap) ++{ ++ struct sabre_ess_priv *sabre_ess; ++ unsigned int chip_id = 0; ++ int ret; ++ ++ sabre_ess = devm_kzalloc(dev, sizeof(struct sabre_ess_priv), ++ GFP_KERNEL); ++ if (!sabre_ess) ++ return -ENOMEM; ++ ++ dev_set_drvdata(dev, sabre_ess); ++ sabre_ess->regmap = regmap; ++ ++ ret = regmap_read(regmap, SABRE_ESS_CHIP_ID_REG, &chip_id); ++ if ((ret != 0) || (chip_id != SABRE_ESS_CHIP_ID)) { ++ dev_err(dev, "Failed to read Chip or wrong Chip id: %d\n", ret); ++ return ret; ++ } ++ regmap_update_bits(regmap, SABRE_ESS_RESET, 0x01, 0x01); ++ msleep(10); ++ ++ ret = snd_soc_register_codec(dev, &sabre_ess_codec_driver, ++ &sabre_ess_dai, 1); ++ if (ret != 0) { ++ dev_err(dev, "failed to register codec: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++EXPORT_SYMBOL_GPL(sabre_ess_probe); ++ ++void sabre_ess_remove(struct device *dev) ++{ ++ snd_soc_unregister_codec(dev); ++ pm_runtime_disable(dev); ++} ++EXPORT_SYMBOL_GPL(sabre_ess_remove); ++ ++MODULE_DESCRIPTION("ASoC SABRE ESS codec driver"); ++MODULE_AUTHOR("Jaikumar "); ++MODULE_LICENSE("GPL v2"); ++ +diff --git a/sound/soc/codecs/sabre-ess.h b/sound/soc/codecs/sabre-ess.h +new file mode 100644 +index 000000000000..cd0922ec3520 +--- /dev/null ++++ b/sound/soc/codecs/sabre-ess.h +@@ -0,0 +1,62 @@ ++/* ++ * Driver for the SABRE ESS CODEC ++ * ++ * Author: Jaikumar ++ * Copyright 2018 ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#ifndef _SND_SOC_SABRE_ESS_ ++#define _SND_SOC_SABRE_ESS_ ++ ++#include ++#include ++ ++#define SABRE_ESS_CHIP_ID 0x30 ++#define SABRE_ESS_VIRT_BASE 0x100 ++#define SABRE_ESS_PAGE 0 ++ ++#define SABRE_ESS_CHIP_ID_REG (SABRE_ESS_VIRT_BASE + 0) ++#define SABRE_ESS_RESET (SABRE_ESS_VIRT_BASE + 1) ++#define SABRE_ESS_VOLUME_1 (SABRE_ESS_VIRT_BASE + 2) ++#define SABRE_ESS_VOLUME_2 (SABRE_ESS_VIRT_BASE + 3) ++#define SABRE_ESS_MUTE (SABRE_ESS_VIRT_BASE + 4) ++#define SABRE_ESS_DSP_PROGRAM (SABRE_ESS_VIRT_BASE + 5) ++#define SABRE_ESS_DEEMPHASIS (SABRE_ESS_VIRT_BASE + 6) ++#define SABRE_ESS_DOP (SABRE_ESS_VIRT_BASE + 7) ++#define SABRE_ESS_FORMAT (SABRE_ESS_VIRT_BASE + 8) ++#define SABRE_ESS_COMMAND (SABRE_ESS_VIRT_BASE + 9) ++#define SABRE_ESS_MAX_REGISTER (SABRE_ESS_VIRT_BASE + 9) ++ ++#define SABRE_ESS_FMT 0xff ++#define SABRE_ESS_CHAN_MONO 0x00 ++#define SABRE_ESS_CHAN_STEREO 0x80 ++#define SABRE_ESS_ALEN_16 0x10 ++#define SABRE_ESS_ALEN_24 0x20 ++#define SABRE_ESS_ALEN_32 0x30 ++#define SABRE_ESS_RATE_11025 0x01 ++#define SABRE_ESS_RATE_22050 0x02 ++#define SABRE_ESS_RATE_32000 0x03 ++#define SABRE_ESS_RATE_44100 0x04 ++#define SABRE_ESS_RATE_48000 0x05 ++#define SABRE_ESS_RATE_88200 0x06 ++#define SABRE_ESS_RATE_96000 0x07 ++#define SABRE_ESS_RATE_176400 0x08 ++#define SABRE_ESS_RATE_192000 0x09 ++#define SABRE_ESS_RATE_352800 0x0a ++#define SABRE_ESS_RATE_384000 0x0b ++ ++extern const struct regmap_config sabre_ess_regmap; ++ ++int sabre_ess_probe(struct device *dev, struct regmap *regmap); ++void sabre_ess_remove(struct device *dev); ++ ++#endif /* _SND_SOC_SABRE_ESS_ */ +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0312-Drivers-for-Allo-Katana-DAC.patch b/root/target/linux/brcm2708/patches-4.14/0312-Drivers-for-Allo-Katana-DAC.patch new file mode 100644 index 00000000..037f80b7 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0312-Drivers-for-Allo-Katana-DAC.patch @@ -0,0 +1,30 @@ +From cd0aa36b609fd44318e71e0326c60fd0f8d0c2fd Mon Sep 17 00:00:00 2001 +From: allocom +Date: Thu, 19 Apr 2018 12:16:03 +0530 +Subject: [PATCH 312/321] Drivers for Allo Katana DAC + +--- + sound/soc/bcm/allo-katana-dac.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/sound/soc/bcm/allo-katana-dac.c b/sound/soc/bcm/allo-katana-dac.c +index 2192df027ac8..fe1a9de45604 100644 +--- a/sound/soc/bcm/allo-katana-dac.c ++++ b/sound/soc/bcm/allo-katana-dac.c +@@ -25,13 +25,10 @@ + static struct snd_soc_dai_link snd_allo_katana_dac_dai[] = { + { + .name = "KATANA DAC", +- //.stream_name = "KATANA DAC HiFi [Master]", + .stream_name = "KATANA DAC", + .cpu_dai_name = "bcm2708-i2s.0", +- //.codec_dai_name = "es9038q2m-hifi", + .codec_dai_name = "sabre-ess", + .platform_name = "bcm2708-i2s.0", +- //.codec_name = "es9038q2m.1-0030", + .codec_name = "sabre-ess.1-0030", + .dai_fmt = SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0313-Driver-for-Allo-Katana-DAC.patch b/root/target/linux/brcm2708/patches-4.14/0313-Driver-for-Allo-Katana-DAC.patch new file mode 100644 index 00000000..3d32e4ce --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0313-Driver-for-Allo-Katana-DAC.patch @@ -0,0 +1,1099 @@ +From b2dd4b2b102248d31180865d587e04bcc9da236d Mon Sep 17 00:00:00 2001 +From: allocom +Date: Tue, 24 Apr 2018 11:19:03 +0530 +Subject: [PATCH 313/321] Driver for Allo Katana DAC + +--- + .../dts/overlays/allo-katana-dac-audio-overlay.dts | 27 +- + sound/soc/bcm/Kconfig | 4 +- + sound/soc/bcm/Makefile | 4 +- + sound/soc/bcm/allo-katana-codec.c | 363 +++++++++++++++++++++ + sound/soc/bcm/allo-katana-dac.c | 102 ------ + sound/soc/codecs/Kconfig | 10 - + sound/soc/codecs/Makefile | 4 - + sound/soc/codecs/sabre-ess-i2c.c | 69 ---- + sound/soc/codecs/sabre-ess.c | 300 ----------------- + sound/soc/codecs/sabre-ess.h | 62 ---- + 10 files changed, 387 insertions(+), 558 deletions(-) + create mode 100644 sound/soc/bcm/allo-katana-codec.c + delete mode 100644 sound/soc/bcm/allo-katana-dac.c + delete mode 100644 sound/soc/codecs/sabre-ess-i2c.c + delete mode 100644 sound/soc/codecs/sabre-ess.c + delete mode 100644 sound/soc/codecs/sabre-ess.h + +diff --git a/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts +index d41ae92e0a5c..6dc4acf1f80c 100644 +--- a/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts +@@ -1,7 +1,5 @@ + /* + * Definitions for Allo Katana DAC boards +- * +- * NB. The Katana DAC board contains SABER DAC. + */ + + /dts-v1/; +@@ -13,7 +11,16 @@ + fragment@0 { + target = <&i2s>; + __overlay__ { ++ #sound-dai-cells = <0>; + status = "okay"; ++ cpu_port: port { ++ cpu_endpoint: endpoint { ++ remote-endpoint = <&codec_endpoint>; ++ bitclock-master = <&codec_endpoint>; ++ frame-master = <&codec_endpoint>; ++ dai-format = "i2s"; ++ }; ++ }; + }; + }; + +@@ -24,11 +31,15 @@ + #size-cells = <0>; + status = "okay"; + +- sabre-ess@30 { ++ allo-katana-codec@30 { + #sound-dai-cells = <0>; +- compatible = "saber,sabre-ess"; ++ compatible = "allo,allo-katana-codec"; + reg = <0x30>; +- status = "okay"; ++ port { ++ codec_endpoint: endpoint { ++ remote-endpoint = <&cpu_endpoint>; ++ }; ++ }; + }; + }; + }; +@@ -36,11 +47,11 @@ + fragment@2 { + target = <&sound>; + katana_dac: __overlay__ { +- compatible = "allo,katana-dac"; +- i2s-controller = <&i2s>; ++ compatible = "audio-graph-card"; ++ label = "Allo Katana"; ++ dais = <&cpu_port>; + status = "okay"; + }; + }; +- + }; + +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index a264f78388c2..21622eda8c60 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -178,7 +178,9 @@ config SND_BCM2708_SOC_ALLO_DIGIONE + config SND_BCM2708_SOC_ALLO_KATANA_DAC + tristate "Support for Allo Katana DAC" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +- select SND_SOC_SABRE_ESS_I2C ++ depends on I2C ++ select REGMAP_I2C ++ select SND_AUDIO_GRAPH_CARD + help + Say Y or M if you want to add support for Allo Katana DAC. + +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 2f99a8360a6a..e96022b866b5 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -34,7 +34,7 @@ snd-soc-allo-boss-dac-objs := allo-boss-dac.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o + snd-soc-allo-digione-objs := allo-digione.o +-snd-soc-allo-katana-dac-objs := allo-katana-dac.o ++snd-soc-allo-katana-codec-objs := allo-katana-codec.o + snd-soc-pisound-objs := pisound.o + snd-soc-fe-pi-audio-objs := fe-pi-audio.o + +@@ -61,6 +61,6 @@ obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE) += snd-soc-allo-digione.o +-obj-$(CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC) += snd-soc-allo-katana-dac.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC) += snd-soc-allo-katana-codec.o + obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o + obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o +diff --git a/sound/soc/bcm/allo-katana-codec.c b/sound/soc/bcm/allo-katana-codec.c +new file mode 100644 +index 000000000000..2b4892f645d9 +--- /dev/null ++++ b/sound/soc/bcm/allo-katana-codec.c +@@ -0,0 +1,363 @@ ++/* ++ * Driver for the ALLO KATANA CODEC ++ * ++ * Author: Jaikumar ++ * Copyright 2018 ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++#define KATANA_CODEC_CHIP_ID 0x30 ++#define KATANA_CODEC_VIRT_BASE 0x100 ++#define KATANA_CODEC_PAGE 0 ++ ++#define KATANA_CODEC_CHIP_ID_REG (KATANA_CODEC_VIRT_BASE + 0) ++#define KATANA_CODEC_RESET (KATANA_CODEC_VIRT_BASE + 1) ++#define KATANA_CODEC_VOLUME_1 (KATANA_CODEC_VIRT_BASE + 2) ++#define KATANA_CODEC_VOLUME_2 (KATANA_CODEC_VIRT_BASE + 3) ++#define KATANA_CODEC_MUTE (KATANA_CODEC_VIRT_BASE + 4) ++#define KATANA_CODEC_DSP_PROGRAM (KATANA_CODEC_VIRT_BASE + 5) ++#define KATANA_CODEC_DEEMPHASIS (KATANA_CODEC_VIRT_BASE + 6) ++#define KATANA_CODEC_DOP (KATANA_CODEC_VIRT_BASE + 7) ++#define KATANA_CODEC_FORMAT (KATANA_CODEC_VIRT_BASE + 8) ++#define KATANA_CODEC_COMMAND (KATANA_CODEC_VIRT_BASE + 9) ++#define KATANA_CODEC_MAX_REGISTER (KATANA_CODEC_VIRT_BASE + 9) ++ ++#define KATANA_CODEC_FMT 0xff ++#define KATANA_CODEC_CHAN_MONO 0x00 ++#define KATANA_CODEC_CHAN_STEREO 0x80 ++#define KATANA_CODEC_ALEN_16 0x10 ++#define KATANA_CODEC_ALEN_24 0x20 ++#define KATANA_CODEC_ALEN_32 0x30 ++#define KATANA_CODEC_RATE_11025 0x01 ++#define KATANA_CODEC_RATE_22050 0x02 ++#define KATANA_CODEC_RATE_32000 0x03 ++#define KATANA_CODEC_RATE_44100 0x04 ++#define KATANA_CODEC_RATE_48000 0x05 ++#define KATANA_CODEC_RATE_88200 0x06 ++#define KATANA_CODEC_RATE_96000 0x07 ++#define KATANA_CODEC_RATE_176400 0x08 ++#define KATANA_CODEC_RATE_192000 0x09 ++#define KATANA_CODEC_RATE_352800 0x0a ++#define KATANA_CODEC_RATE_384000 0x0b ++ ++ ++struct katana_codec_priv { ++ struct regmap *regmap; ++ int fmt; ++}; ++ ++static const struct reg_default katana_codec_reg_defaults[] = { ++ { KATANA_CODEC_RESET, 0x00 }, ++ { KATANA_CODEC_VOLUME_1, 0xF0 }, ++ { KATANA_CODEC_VOLUME_2, 0xF0 }, ++ { KATANA_CODEC_MUTE, 0x00 }, ++ { KATANA_CODEC_DSP_PROGRAM, 0x04 }, ++ { KATANA_CODEC_DEEMPHASIS, 0x00 }, ++ { KATANA_CODEC_DOP, 0x01 }, ++ { KATANA_CODEC_FORMAT, 0xb4 }, ++}; ++ ++static const char * const katana_codec_dsp_program_texts[] = { ++ "Linear Phase Fast Roll-off Filter", ++ "Linear Phase Slow Roll-off Filter", ++ "Minimum Phase Fast Roll-off Filter", ++ "Minimum Phase Slow Roll-off Filter", ++ "Apodizing Fast Roll-off Filter", ++ "Corrected Minimum Phase Fast Roll-off Filter", ++ "Brick Wall Filter", ++}; ++ ++static const unsigned int katana_codec_dsp_program_values[] = { ++ 0, ++ 1, ++ 2, ++ 3, ++ 4, ++ 6, ++ 7, ++}; ++ ++static SOC_VALUE_ENUM_SINGLE_DECL(katana_codec_dsp_program, ++ KATANA_CODEC_DSP_PROGRAM, 0, 0x07, ++ katana_codec_dsp_program_texts, ++ katana_codec_dsp_program_values); ++ ++static const char * const katana_codec_deemphasis_texts[] = { ++ "Bypass", ++ "32kHz", ++ "44.1kHz", ++ "48kHz", ++}; ++ ++static const unsigned int katana_codec_deemphasis_values[] = { ++ 0, ++ 1, ++ 2, ++ 3, ++}; ++ ++static SOC_VALUE_ENUM_SINGLE_DECL(katana_codec_deemphasis, ++ KATANA_CODEC_DEEMPHASIS, 0, 0x03, ++ katana_codec_deemphasis_texts, ++ katana_codec_deemphasis_values); ++ ++static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(master_tlv, -12700, 0); ++ ++static const struct snd_kcontrol_new katana_codec_controls[] = { ++ SOC_DOUBLE_R_TLV("Master Playback Volume", KATANA_CODEC_VOLUME_1, ++ KATANA_CODEC_VOLUME_2, 0, 255, 1, master_tlv), ++ SOC_DOUBLE("Master Playback Switch", KATANA_CODEC_MUTE, 0, 0, 1, 1), ++ SOC_ENUM("DSP Program Route", katana_codec_dsp_program), ++ SOC_ENUM("Deemphasis Route", katana_codec_deemphasis), ++ SOC_SINGLE("DoP Playback Switch", KATANA_CODEC_DOP, 0, 1, 1) ++}; ++ ++static bool katana_codec_readable_register(struct device *dev, unsigned int reg) ++{ ++ switch (reg) { ++ case KATANA_CODEC_CHIP_ID_REG: ++ return true; ++ default: ++ return reg < 0xff; ++ } ++} ++ ++static int katana_codec_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params, ++ struct snd_soc_dai *dai) ++{ ++ struct snd_soc_codec *codec = dai->codec; ++ struct katana_codec_priv *katana_codec = snd_soc_codec_get_drvdata(codec); ++ int fmt = 0; ++ int ret; ++ ++ dev_dbg(codec->dev, "hw_params %u Hz, %u channels\n", ++ params_rate(params), ++ params_channels(params)); ++ ++ switch (katana_codec->fmt & SND_SOC_DAIFMT_MASTER_MASK) { ++ case SND_SOC_DAIFMT_CBM_CFM: // master ++ if (params_channels(params) == 2) ++ fmt = KATANA_CODEC_CHAN_STEREO; ++ else ++ fmt = KATANA_CODEC_CHAN_MONO; ++ ++ switch (params_width(params)) { ++ case 16: ++ fmt |= KATANA_CODEC_ALEN_16; ++ break; ++ case 24: ++ fmt |= KATANA_CODEC_ALEN_24; ++ break; ++ case 32: ++ fmt |= KATANA_CODEC_ALEN_32; ++ break; ++ default: ++ dev_err(codec->dev, "Bad frame size: %d\n", ++ params_width(params)); ++ return -EINVAL; ++ } ++ ++ switch (params_rate(params)) { ++ case 44100: ++ fmt |= KATANA_CODEC_RATE_44100; ++ break; ++ case 48000: ++ fmt |= KATANA_CODEC_RATE_48000; ++ break; ++ case 88200: ++ fmt |= KATANA_CODEC_RATE_88200; ++ break; ++ case 96000: ++ fmt |= KATANA_CODEC_RATE_96000; ++ break; ++ case 176400: ++ fmt |= KATANA_CODEC_RATE_176400; ++ break; ++ case 192000: ++ fmt |= KATANA_CODEC_RATE_192000; ++ break; ++ case 352800: ++ fmt |= KATANA_CODEC_RATE_352800; ++ break; ++ case 384000: ++ fmt |= KATANA_CODEC_RATE_384000; ++ break; ++ default: ++ dev_err(codec->dev, "Bad sample rate: %d\n", ++ params_rate(params)); ++ return -EINVAL; ++ } ++ ++ ret = regmap_write(katana_codec->regmap, KATANA_CODEC_FORMAT, fmt); ++ if (ret != 0) { ++ dev_err(codec->dev, "Failed to set format: %d\n", ret); ++ return ret; ++ } ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++static int katana_codec_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ++{ ++ struct snd_soc_codec *codec = dai->codec; ++ struct katana_codec_priv *katana_codec = snd_soc_codec_get_drvdata(codec); ++ ++ katana_codec->fmt = fmt; ++ ++ return 0; ++} ++ ++static const struct snd_soc_dai_ops katana_codec_dai_ops = { ++ .hw_params = katana_codec_hw_params, ++ .set_fmt = katana_codec_set_fmt, ++}; ++ ++static struct snd_soc_dai_driver katana_codec_dai = { ++ .name = "allo-katana-codec", ++ .playback = { ++ .stream_name = "Playback", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = SNDRV_PCM_RATE_CONTINUOUS, ++ .rate_min = 44100, ++ .rate_max = 384000, ++ .formats = SNDRV_PCM_FMTBIT_S16_LE | ++ SNDRV_PCM_FMTBIT_S32_LE ++ }, ++ .ops = &katana_codec_dai_ops, ++}; ++ ++static struct snd_soc_codec_driver katana_codec_codec_driver = { ++ .idle_bias_off = false, ++ ++ .component_driver = { ++ .controls = katana_codec_controls, ++ .num_controls = ARRAY_SIZE(katana_codec_controls), ++ }, ++}; ++ ++static const struct regmap_range_cfg katana_codec_range = { ++ .name = "Pages", .range_min = KATANA_CODEC_VIRT_BASE, ++ .range_max = KATANA_CODEC_MAX_REGISTER, ++ .selector_reg = KATANA_CODEC_PAGE, ++ .selector_mask = 0xff, ++ .window_start = 0, .window_len = 0x100, ++}; ++ ++const struct regmap_config katana_codec_regmap = { ++ .reg_bits = 8, ++ .val_bits = 8, ++ ++ .ranges = &katana_codec_range, ++ .num_ranges = 1, ++ ++ .max_register = KATANA_CODEC_MAX_REGISTER, ++ .readable_reg = katana_codec_readable_register, ++ .reg_defaults = katana_codec_reg_defaults, ++ .num_reg_defaults = ARRAY_SIZE(katana_codec_reg_defaults), ++ .cache_type = REGCACHE_RBTREE, ++}; ++ ++static int allo_katana_codec_probe(struct i2c_client *i2c, ++ const struct i2c_device_id *id) ++{ ++ struct regmap *regmap; ++ struct regmap_config config = katana_codec_regmap; ++ struct device *dev = &i2c->dev; ++ struct katana_codec_priv *katana_codec; ++ unsigned int chip_id = 0; ++ int ret; ++ ++ regmap = devm_regmap_init_i2c(i2c, &config); ++ if (IS_ERR(regmap)) ++ return PTR_ERR(regmap); ++ ++ katana_codec = devm_kzalloc(dev, sizeof(struct katana_codec_priv), ++ GFP_KERNEL); ++ if (!katana_codec) ++ return -ENOMEM; ++ ++ dev_set_drvdata(dev, katana_codec); ++ katana_codec->regmap = regmap; ++ ++ ret = regmap_read(regmap, KATANA_CODEC_CHIP_ID_REG, &chip_id); ++ if ((ret != 0) || (chip_id != KATANA_CODEC_CHIP_ID)) { ++ dev_err(dev, "Failed to read Chip or wrong Chip id: %d\n", ret); ++ return ret; ++ } ++ regmap_update_bits(regmap, KATANA_CODEC_RESET, 0x01, 0x01); ++ msleep(10); ++ ++ ret = snd_soc_register_codec(dev, &katana_codec_codec_driver, ++ &katana_codec_dai, 1); ++ if (ret != 0) { ++ dev_err(dev, "failed to register codec: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int allo_katana_codec_remove(struct i2c_client *i2c) ++{ ++ snd_soc_unregister_codec(&i2c->dev); ++ return 0; ++} ++ ++static const struct i2c_device_id allo_katana_codec_id[] = { ++ { "allo-katana-codec", }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, allo_katana_codec_id); ++ ++static const struct of_device_id allo_katana_codec_of_match[] = { ++ { .compatible = "allo,allo-katana-codec", }, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, allo_katana_codec_of_match); ++ ++static struct i2c_driver allo_katana_codec_driver = { ++ .probe = allo_katana_codec_probe, ++ .remove = allo_katana_codec_remove, ++ .id_table = allo_katana_codec_id, ++ .driver = { ++ .name = "allo-katana-codec", ++ .of_match_table = allo_katana_codec_of_match, ++ }, ++}; ++ ++module_i2c_driver(allo_katana_codec_driver); ++ ++MODULE_DESCRIPTION("ASoC Allo Katana Codec Driver"); ++MODULE_AUTHOR("Jaikumar "); ++MODULE_LICENSE("GPL v2"); ++ +diff --git a/sound/soc/bcm/allo-katana-dac.c b/sound/soc/bcm/allo-katana-dac.c +deleted file mode 100644 +index fe1a9de45604..000000000000 +--- a/sound/soc/bcm/allo-katana-dac.c ++++ /dev/null +@@ -1,102 +0,0 @@ +-/* +- * ASoC Driver for KATANA DAC +- * +- * Author: Jaikumar +- * Copyright 2018 +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-static struct snd_soc_dai_link snd_allo_katana_dac_dai[] = { +-{ +- .name = "KATANA DAC", +- .stream_name = "KATANA DAC", +- .cpu_dai_name = "bcm2708-i2s.0", +- .codec_dai_name = "sabre-ess", +- .platform_name = "bcm2708-i2s.0", +- .codec_name = "sabre-ess.1-0030", +- .dai_fmt = SND_SOC_DAIFMT_I2S | +- SND_SOC_DAIFMT_NB_NF | +- SND_SOC_DAIFMT_CBM_CFM, +-}, +-}; +- +-/* audio machine driver */ +-static struct snd_soc_card snd_allo_katana_dac = { +- .name = "snd_allo_katana_dac", +- .owner = THIS_MODULE, +- .dai_link = snd_allo_katana_dac_dai, +- .num_links = ARRAY_SIZE(snd_allo_katana_dac_dai), +-}; +- +-static int snd_allo_katana_dac_probe(struct platform_device *pdev) +-{ +- int ret = 0; +- +- snd_allo_katana_dac.dev = &pdev->dev; +- +- if (pdev->dev.of_node) { +- struct device_node *i2s_node; +- struct snd_soc_dai_link *dai = &snd_allo_katana_dac_dai[0]; +- +- i2s_node = of_parse_phandle(pdev->dev.of_node, +- "i2s-controller", 0); +- +- if (i2s_node) { +- dai->cpu_dai_name = NULL; +- dai->cpu_of_node = i2s_node; +- dai->platform_name = NULL; +- dai->platform_of_node = i2s_node; +- } +- } +- +- ret = snd_soc_register_card(&snd_allo_katana_dac); +- if (ret && ret != -EPROBE_DEFER) +- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", +- ret); +- +- return ret; +-} +- +-static int snd_allo_katana_dac_remove(struct platform_device *pdev) +-{ +- return snd_soc_unregister_card(&snd_allo_katana_dac); +-} +- +-static const struct of_device_id snd_allo_katana_dac_of_match[] = { +- { .compatible = "allo,katana-dac", }, +- {}, +-}; +-MODULE_DEVICE_TABLE(of, snd_allo_katana_dac_of_match); +- +-static struct platform_driver snd_allo_katana_dac_driver = { +- .driver = { +- .name = "snd-katana-dac", +- .owner = THIS_MODULE, +- .of_match_table = snd_allo_katana_dac_of_match, +- }, +- .probe = snd_allo_katana_dac_probe, +- .remove = snd_allo_katana_dac_remove, +-}; +- +-module_platform_driver(snd_allo_katana_dac_driver); +- +-MODULE_AUTHOR("Jaikumar "); +-MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Katana DAC"); +-MODULE_LICENSE("GPL v2"); +- +diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig +index b52aab582303..b3c63d86e5ef 100644 +--- a/sound/soc/codecs/Kconfig ++++ b/sound/soc/codecs/Kconfig +@@ -77,7 +77,6 @@ config SND_SOC_ALL_CODECS + select SND_SOC_ES8328_SPI if SPI_MASTER + select SND_SOC_ES8328_I2C if I2C + select SND_SOC_ES7134 +- select SND_SOC_SABRE_ESS_I2C if I2C + select SND_SOC_GTM601 + select SND_SOC_HDAC_HDMI + select SND_SOC_ICS43432 +@@ -1187,13 +1186,4 @@ config SND_SOC_TPA6130A2 + tristate "Texas Instruments TPA6130A2 headphone amplifier" + depends on I2C + +-config SND_SOC_SABRE_ESS +- tristate +- +-config SND_SOC_SABRE_ESS_I2C +- tristate "Sabre SABRE ESS CODEC - I2C" +- depends on I2C +- select SND_SOC_SABRE_ESS +- select REGMAP_I2C +- + endmenu +diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile +index 6e90e1f7d531..f910415bdd31 100644 +--- a/sound/soc/codecs/Makefile ++++ b/sound/soc/codecs/Makefile +@@ -71,8 +71,6 @@ snd-soc-es8316-objs := es8316.o + snd-soc-es8328-objs := es8328.o + snd-soc-es8328-i2c-objs := es8328-i2c.o + snd-soc-es8328-spi-objs := es8328-spi.o +-snd-soc-sabre-ess-objs := sabre-ess.o +-snd-soc-sabre-ess-i2c-objs := sabre-ess-i2c.o + snd-soc-gtm601-objs := gtm601.o + snd-soc-hdac-hdmi-objs := hdac_hdmi.o + snd-soc-ics43432-objs := ics43432.o +@@ -315,8 +313,6 @@ obj-$(CONFIG_SND_SOC_ES8316) += snd-soc-es8316.o + obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o + obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o + obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o +-obj-$(CONFIG_SND_SOC_SABRE_ESS) += snd-soc-sabre-ess.o +-obj-$(CONFIG_SND_SOC_SABRE_ESS_I2C) += snd-soc-sabre-ess-i2c.o + obj-$(CONFIG_SND_SOC_GTM601) += snd-soc-gtm601.o + obj-$(CONFIG_SND_SOC_HDAC_HDMI) += snd-soc-hdac-hdmi.o + obj-$(CONFIG_SND_SOC_ICS43432) += snd-soc-ics43432.o +diff --git a/sound/soc/codecs/sabre-ess-i2c.c b/sound/soc/codecs/sabre-ess-i2c.c +deleted file mode 100644 +index a1ecae6edc0b..000000000000 +--- a/sound/soc/codecs/sabre-ess-i2c.c ++++ /dev/null +@@ -1,69 +0,0 @@ +-/* +- * Driver for the SABRE ESS CODECs +- * +- * Author: Jaikumar +- * Copyright 2018 +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#include +-#include +-#include +- +-#include "sabre-ess.h" +- +-static int sabre_ess_i2c_probe(struct i2c_client *i2c, +- const struct i2c_device_id *id) +-{ +- struct regmap *regmap; +- struct regmap_config config = sabre_ess_regmap; +- +- regmap = devm_regmap_init_i2c(i2c, &config); +- if (IS_ERR(regmap)) +- return PTR_ERR(regmap); +- +- return sabre_ess_probe(&i2c->dev, regmap); +-} +- +-static int sabre_ess_i2c_remove(struct i2c_client *i2c) +-{ +- sabre_ess_remove(&i2c->dev); +- return 0; +-} +- +-static const struct i2c_device_id sabre_ess_i2c_id[] = { +- { "sabre-ess", }, +- { } +-}; +-MODULE_DEVICE_TABLE(i2c, sabre_ess_i2c_id); +- +-static const struct of_device_id sabre_ess_of_match[] = { +- { .compatible = "saber,sabre-ess", }, +- { } +-}; +-MODULE_DEVICE_TABLE(of, sabre_ess_of_match); +- +-static struct i2c_driver sabre_ess_i2c_driver = { +- .probe = sabre_ess_i2c_probe, +- .remove = sabre_ess_i2c_remove, +- .id_table = sabre_ess_i2c_id, +- .driver = { +- .name = "sabre-ess", +- .of_match_table = sabre_ess_of_match, +- }, +-}; +- +-module_i2c_driver(sabre_ess_i2c_driver); +- +-MODULE_DESCRIPTION("ASoC SABRE ESS codec driver - I2C"); +-MODULE_AUTHOR("Jaikumar "); +-MODULE_LICENSE("GPL v2"); +- +diff --git a/sound/soc/codecs/sabre-ess.c b/sound/soc/codecs/sabre-ess.c +deleted file mode 100644 +index bf8ec949fc28..000000000000 +--- a/sound/soc/codecs/sabre-ess.c ++++ /dev/null +@@ -1,300 +0,0 @@ +-/* +- * Driver for the SABRE ESS CODEC +- * +- * Author: Jaikumar +- * Copyright 2018 +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include "sabre-ess.h" +- +-struct sabre_ess_priv { +- struct regmap *regmap; +- int fmt; +-}; +- +-static const struct reg_default sabre_ess_reg_defaults[] = { +- { SABRE_ESS_RESET, 0x00 }, +- { SABRE_ESS_VOLUME_1, 0xF0 }, +- { SABRE_ESS_VOLUME_2, 0xF0 }, +- { SABRE_ESS_MUTE, 0x00 }, +- { SABRE_ESS_DSP_PROGRAM, 0x04 }, +- { SABRE_ESS_DEEMPHASIS, 0x00 }, +- { SABRE_ESS_DOP, 0x01 }, +- { SABRE_ESS_FORMAT, 0xb4 }, +-}; +- +-static const char * const sabre_ess_dsp_program_texts[] = { +- "Linear Phase Fast Roll-off Filter", +- "Linear Phase Slow Roll-off Filter", +- "Minimum Phase Fast Roll-off Filter", +- "Minimum Phase Slow Roll-off Filter", +- "Apodizing Fast Roll-off Filter", +- "Corrected Minimum Phase Fast Roll-off Filter", +- "Brick Wall Filter", +-}; +- +-static const unsigned int sabre_ess_dsp_program_values[] = { +- 0, +- 1, +- 2, +- 3, +- 4, +- 6, +- 7, +-}; +- +-static SOC_VALUE_ENUM_SINGLE_DECL(sabre_ess_dsp_program, +- SABRE_ESS_DSP_PROGRAM, 0, 0x07, +- sabre_ess_dsp_program_texts, +- sabre_ess_dsp_program_values); +- +-static const char * const sabre_ess_deemphasis_texts[] = { +- "Bypass", +- "32kHz", +- "44.1kHz", +- "48kHz", +-}; +- +-static const unsigned int sabre_ess_deemphasis_values[] = { +- 0, +- 1, +- 2, +- 3, +-}; +- +-static SOC_VALUE_ENUM_SINGLE_DECL(sabre_ess_deemphasis, +- SABRE_ESS_DEEMPHASIS, 0, 0x03, +- sabre_ess_deemphasis_texts, +- sabre_ess_deemphasis_values); +- +-static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(master_tlv, -12700, 0); +- +-static const struct snd_kcontrol_new sabre_ess_controls[] = { +- SOC_DOUBLE_R_TLV("Master Playback Volume", SABRE_ESS_VOLUME_1, +- SABRE_ESS_VOLUME_2, 0, 255, 1, master_tlv), +- SOC_DOUBLE("Master Playback Switch", SABRE_ESS_MUTE, 0, 0, 1, 1), +- SOC_ENUM("DSP Program Route", sabre_ess_dsp_program), +- SOC_ENUM("Deemphasis Route", sabre_ess_deemphasis), +- SOC_SINGLE("DoP Playback Switch", SABRE_ESS_DOP, 0, 1, 1) +-}; +- +-static bool sabre_ess_readable_register(struct device *dev, unsigned int reg) +-{ +- switch (reg) { +- case SABRE_ESS_CHIP_ID_REG: +- return true; +- default: +- return reg < 0xff; +- } +-} +- +-static int sabre_ess_hw_params(struct snd_pcm_substream *substream, +- struct snd_pcm_hw_params *params, +- struct snd_soc_dai *dai) +-{ +- struct snd_soc_codec *codec = dai->codec; +- struct sabre_ess_priv *sabre_ess = snd_soc_codec_get_drvdata(codec); +- int fmt = 0; +- int ret; +- +- dev_dbg(codec->dev, "hw_params %u Hz, %u channels\n", +- params_rate(params), +- params_channels(params)); +- +- switch (sabre_ess->fmt & SND_SOC_DAIFMT_MASTER_MASK) { +- case SND_SOC_DAIFMT_CBM_CFM: // master +- if (params_channels(params) == 2) +- fmt = SABRE_ESS_CHAN_STEREO; +- else +- fmt = SABRE_ESS_CHAN_MONO; +- +- switch (params_width(params)) { +- case 16: +- fmt |= SABRE_ESS_ALEN_16; +- break; +- case 24: +- fmt |= SABRE_ESS_ALEN_24; +- break; +- case 32: +- fmt |= SABRE_ESS_ALEN_32; +- break; +- default: +- dev_err(codec->dev, "Bad frame size: %d\n", +- params_width(params)); +- return -EINVAL; +- } +- +- switch (params_rate(params)) { +- case 44100: +- fmt |= SABRE_ESS_RATE_44100; +- break; +- case 48000: +- fmt |= SABRE_ESS_RATE_48000; +- break; +- case 88200: +- fmt |= SABRE_ESS_RATE_88200; +- break; +- case 96000: +- fmt |= SABRE_ESS_RATE_96000; +- break; +- case 176400: +- fmt |= SABRE_ESS_RATE_176400; +- break; +- case 192000: +- fmt |= SABRE_ESS_RATE_192000; +- break; +- case 352800: +- fmt |= SABRE_ESS_RATE_352800; +- break; +- case 384000: +- fmt |= SABRE_ESS_RATE_384000; +- break; +- default: +- dev_err(codec->dev, "Bad sample rate: %d\n", +- params_rate(params)); +- return -EINVAL; +- } +- +- ret = regmap_write(sabre_ess->regmap, SABRE_ESS_FORMAT, fmt); +- if (ret != 0) { +- dev_err(codec->dev, "Failed to set format: %d\n", ret); +- return ret; +- } +- break; +- +- default: +- return -EINVAL; +- } +- +- return 0; +-} +- +-static int sabre_ess_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) +-{ +- struct snd_soc_codec *codec = dai->codec; +- struct sabre_ess_priv *sabre_ess = snd_soc_codec_get_drvdata(codec); +- +- sabre_ess->fmt = fmt; +- +- return 0; +-} +- +-static const struct snd_soc_dai_ops sabre_ess_dai_ops = { +- .hw_params = sabre_ess_hw_params, +- .set_fmt = sabre_ess_set_fmt, +-}; +- +-static struct snd_soc_dai_driver sabre_ess_dai = { +- .name = "sabre-ess", +- .playback = { +- .stream_name = "Playback", +- .channels_min = 2, +- .channels_max = 2, +- .rates = SNDRV_PCM_RATE_CONTINUOUS, +- .rate_min = 44100, +- .rate_max = 384000, +- .formats = SNDRV_PCM_FMTBIT_S16_LE | +- SNDRV_PCM_FMTBIT_S32_LE +- }, +- .ops = &sabre_ess_dai_ops, +-}; +- +-static struct snd_soc_codec_driver sabre_ess_codec_driver = { +- .idle_bias_off = false, +- +- .component_driver = { +- .controls = sabre_ess_controls, +- .num_controls = ARRAY_SIZE(sabre_ess_controls), +- }, +-}; +- +-static const struct regmap_range_cfg sabre_ess_range = { +- .name = "Pages", .range_min = SABRE_ESS_VIRT_BASE, +- .range_max = SABRE_ESS_MAX_REGISTER, +- .selector_reg = SABRE_ESS_PAGE, +- .selector_mask = 0xff, +- .window_start = 0, .window_len = 0x100, +-}; +- +-const struct regmap_config sabre_ess_regmap = { +- .reg_bits = 8, +- .val_bits = 8, +- +- .ranges = &sabre_ess_range, +- .num_ranges = 1, +- +- .max_register = SABRE_ESS_MAX_REGISTER, +- .readable_reg = sabre_ess_readable_register, +- .reg_defaults = sabre_ess_reg_defaults, +- .num_reg_defaults = ARRAY_SIZE(sabre_ess_reg_defaults), +- .cache_type = REGCACHE_RBTREE, +-}; +-EXPORT_SYMBOL_GPL(sabre_ess_regmap); +- +-int sabre_ess_probe(struct device *dev, struct regmap *regmap) +-{ +- struct sabre_ess_priv *sabre_ess; +- unsigned int chip_id = 0; +- int ret; +- +- sabre_ess = devm_kzalloc(dev, sizeof(struct sabre_ess_priv), +- GFP_KERNEL); +- if (!sabre_ess) +- return -ENOMEM; +- +- dev_set_drvdata(dev, sabre_ess); +- sabre_ess->regmap = regmap; +- +- ret = regmap_read(regmap, SABRE_ESS_CHIP_ID_REG, &chip_id); +- if ((ret != 0) || (chip_id != SABRE_ESS_CHIP_ID)) { +- dev_err(dev, "Failed to read Chip or wrong Chip id: %d\n", ret); +- return ret; +- } +- regmap_update_bits(regmap, SABRE_ESS_RESET, 0x01, 0x01); +- msleep(10); +- +- ret = snd_soc_register_codec(dev, &sabre_ess_codec_driver, +- &sabre_ess_dai, 1); +- if (ret != 0) { +- dev_err(dev, "failed to register codec: %d\n", ret); +- return ret; +- } +- +- return 0; +-} +-EXPORT_SYMBOL_GPL(sabre_ess_probe); +- +-void sabre_ess_remove(struct device *dev) +-{ +- snd_soc_unregister_codec(dev); +- pm_runtime_disable(dev); +-} +-EXPORT_SYMBOL_GPL(sabre_ess_remove); +- +-MODULE_DESCRIPTION("ASoC SABRE ESS codec driver"); +-MODULE_AUTHOR("Jaikumar "); +-MODULE_LICENSE("GPL v2"); +- +diff --git a/sound/soc/codecs/sabre-ess.h b/sound/soc/codecs/sabre-ess.h +deleted file mode 100644 +index cd0922ec3520..000000000000 +--- a/sound/soc/codecs/sabre-ess.h ++++ /dev/null +@@ -1,62 +0,0 @@ +-/* +- * Driver for the SABRE ESS CODEC +- * +- * Author: Jaikumar +- * Copyright 2018 +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#ifndef _SND_SOC_SABRE_ESS_ +-#define _SND_SOC_SABRE_ESS_ +- +-#include +-#include +- +-#define SABRE_ESS_CHIP_ID 0x30 +-#define SABRE_ESS_VIRT_BASE 0x100 +-#define SABRE_ESS_PAGE 0 +- +-#define SABRE_ESS_CHIP_ID_REG (SABRE_ESS_VIRT_BASE + 0) +-#define SABRE_ESS_RESET (SABRE_ESS_VIRT_BASE + 1) +-#define SABRE_ESS_VOLUME_1 (SABRE_ESS_VIRT_BASE + 2) +-#define SABRE_ESS_VOLUME_2 (SABRE_ESS_VIRT_BASE + 3) +-#define SABRE_ESS_MUTE (SABRE_ESS_VIRT_BASE + 4) +-#define SABRE_ESS_DSP_PROGRAM (SABRE_ESS_VIRT_BASE + 5) +-#define SABRE_ESS_DEEMPHASIS (SABRE_ESS_VIRT_BASE + 6) +-#define SABRE_ESS_DOP (SABRE_ESS_VIRT_BASE + 7) +-#define SABRE_ESS_FORMAT (SABRE_ESS_VIRT_BASE + 8) +-#define SABRE_ESS_COMMAND (SABRE_ESS_VIRT_BASE + 9) +-#define SABRE_ESS_MAX_REGISTER (SABRE_ESS_VIRT_BASE + 9) +- +-#define SABRE_ESS_FMT 0xff +-#define SABRE_ESS_CHAN_MONO 0x00 +-#define SABRE_ESS_CHAN_STEREO 0x80 +-#define SABRE_ESS_ALEN_16 0x10 +-#define SABRE_ESS_ALEN_24 0x20 +-#define SABRE_ESS_ALEN_32 0x30 +-#define SABRE_ESS_RATE_11025 0x01 +-#define SABRE_ESS_RATE_22050 0x02 +-#define SABRE_ESS_RATE_32000 0x03 +-#define SABRE_ESS_RATE_44100 0x04 +-#define SABRE_ESS_RATE_48000 0x05 +-#define SABRE_ESS_RATE_88200 0x06 +-#define SABRE_ESS_RATE_96000 0x07 +-#define SABRE_ESS_RATE_176400 0x08 +-#define SABRE_ESS_RATE_192000 0x09 +-#define SABRE_ESS_RATE_352800 0x0a +-#define SABRE_ESS_RATE_384000 0x0b +- +-extern const struct regmap_config sabre_ess_regmap; +- +-int sabre_ess_probe(struct device *dev, struct regmap *regmap); +-void sabre_ess_remove(struct device *dev); +- +-#endif /* _SND_SOC_SABRE_ESS_ */ +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0314-Driver-for-Allo-Katana-DAC.patch b/root/target/linux/brcm2708/patches-4.14/0314-Driver-for-Allo-Katana-DAC.patch new file mode 100644 index 00000000..dada7c32 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0314-Driver-for-Allo-Katana-DAC.patch @@ -0,0 +1,27 @@ +From 2b9067632825c2ce9cc82785380ebf1997cd5941 Mon Sep 17 00:00:00 2001 +From: allocom +Date: Wed, 25 Apr 2018 11:43:20 +0530 +Subject: [PATCH 314/321] Driver for Allo Katana DAC + +--- + arch/arm/boot/dts/overlays/README | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 889c487dcdc3..e00c7e10c2bc 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -317,8 +317,8 @@ Load: dtoverlay=allo-digione + Params: + + +-Name: allo-katana +-Info: Configures the Allo Katana audio card ++Name: allo-katana-dac-audio ++Info: Configures the Allo Katana DAC audio card + Load: dtoverlay=allo-katana-dac-audio + Params: + +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0315-Reduce-log-spam-when-mailbox-call-not-implemented.patch b/root/target/linux/brcm2708/patches-4.14/0315-Reduce-log-spam-when-mailbox-call-not-implemented.patch new file mode 100644 index 00000000..a766e387 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0315-Reduce-log-spam-when-mailbox-call-not-implemented.patch @@ -0,0 +1,83 @@ +From 2d10f84234bce44d6cb31be728bb3c3732154731 Mon Sep 17 00:00:00 2001 +From: James Hughes +Date: Fri, 27 Apr 2018 10:13:35 +0100 +Subject: [PATCH 315/321] Reduce log spam when mailbox call not implemented + +This changes the logging message when a mailbox call +fails to the dev_dbg level. In addition, it fixes the +low voltage detection logging code so that if the +mailbox call doies fails, it logs at error level +and flags so the call is no longer attempted. + +Signed-off-by: James Hughes +--- + drivers/firmware/raspberrypi.c | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +index 3c96a27734b6..d1943a7e68cf 100644 +--- a/drivers/firmware/raspberrypi.c ++++ b/drivers/firmware/raspberrypi.c +@@ -151,7 +151,7 @@ int rpi_firmware_property_list(struct rpi_firmware *fw, + * error, if there were multiple tags in the request. + * But single-tag is the most common, so go with it. + */ +- dev_err(fw->cl.dev, "Request 0x%08x returned status 0x%08x\n", ++ dev_dbg(fw->cl.dev, "Request 0x%08x returned status 0x%08x\n", + buf[2], buf[1]); + ret = -EINVAL; + } +@@ -204,6 +204,7 @@ EXPORT_SYMBOL_GPL(rpi_firmware_property); + + static int rpi_firmware_get_throttled(struct rpi_firmware *fw, u32 *value) + { ++ static int old_firmware; + static ktime_t old_timestamp; + static u32 old_value; + u32 new_sticky, old_sticky, new_uv, old_uv; +@@ -214,6 +215,9 @@ static int rpi_firmware_get_throttled(struct rpi_firmware *fw, u32 *value) + if (!fw) + return -EBUSY; + ++ if (old_firmware) ++ return -EINVAL; ++ + /* + * We can't run faster than the sticky shift (100ms) since we get + * flipping in the sticky bits that are cleared. +@@ -232,8 +236,17 @@ static int rpi_firmware_get_throttled(struct rpi_firmware *fw, u32 *value) + + ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_THROTTLED, + value, sizeof(*value)); +- if (ret) ++ ++ if (ret) { ++ /* If the mailbox call fails once, then it will continue to ++ * fail in the future, so no point in continuing to call it ++ * Usual failure reason is older firmware ++ */ ++ old_firmware = 1; ++ dev_err(fw->cl.dev, "Get Throttled mailbox call failed"); ++ + return ret; ++ } + + new_sticky = *value >> 16; + old_sticky = old_value >> 16; +@@ -270,10 +283,10 @@ static void get_throttled_poll(struct work_struct *work) + int ret; + + ret = rpi_firmware_get_throttled(fw, &dummy); +- if (ret) +- pr_debug("%s: Failed to read value (%d)", __func__, ret); + +- schedule_delayed_work(&fw->get_throttled_poll_work, 2 * HZ); ++ /* Only reschedule if we are getting valid responses */ ++ if (!ret) ++ schedule_delayed_work(&fw->get_throttled_poll_work, 2 * HZ); + } + + static ssize_t get_throttled_show(struct device *dev, +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0316-config-Add-I2C_TINY_USB-m.patch b/root/target/linux/brcm2708/patches-4.14/0316-config-Add-I2C_TINY_USB-m.patch new file mode 100644 index 00000000..c629c6fd --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0316-config-Add-I2C_TINY_USB-m.patch @@ -0,0 +1,58 @@ +From e5c309d32b8b0e1c2b05b2f1d37b86cbec3c38de Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 27 Apr 2018 16:21:33 +0100 +Subject: [PATCH 316/321] config: Add I2C_TINY_USB=m + +Enable the I2C Tiny USB module. + +See: https://github.com/raspberrypi/linux/issues/2535 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 2 +- + arch/arm/configs/bcmrpi_defconfig | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 2f902b65509f..eba29651e1a5 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -610,6 +610,7 @@ CONFIG_I2C_BCM2708=m + CONFIG_I2C_BCM2835=m + CONFIG_I2C_GPIO=m + CONFIG_I2C_ROBOTFUZZ_OSIF=m ++CONFIG_I2C_TINY_USB=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m +@@ -904,7 +905,6 @@ CONFIG_SND_SOC_CS4271_I2C=m + CONFIG_SND_SOC_SPDIF=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m +-CONFIG_SND_AUDIO_GRAPH_CARD=m + CONFIG_HID_BATTERY_STRENGTH=y + CONFIG_HIDRAW=y + CONFIG_UHID=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index d92421ab31e6..4c0117e03bcd 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -605,6 +605,7 @@ CONFIG_I2C_BCM2708=m + CONFIG_I2C_BCM2835=m + CONFIG_I2C_GPIO=m + CONFIG_I2C_ROBOTFUZZ_OSIF=m ++CONFIG_I2C_TINY_USB=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m +@@ -897,7 +898,6 @@ CONFIG_SND_SOC_CS4271_I2C=m + CONFIG_SND_SOC_SPDIF=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m +-CONFIG_SND_AUDIO_GRAPH_CARD=m + CONFIG_HID_BATTERY_STRENGTH=y + CONFIG_HIDRAW=y + CONFIG_UHID=m +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0317-ARM-bcm_defconfig-Re-enable-QCA7000-SPI-driver.patch b/root/target/linux/brcm2708/patches-4.14/0317-ARM-bcm_defconfig-Re-enable-QCA7000-SPI-driver.patch new file mode 100644 index 00000000..8ef1d9b6 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0317-ARM-bcm_defconfig-Re-enable-QCA7000-SPI-driver.patch @@ -0,0 +1,56 @@ +From 5fc33ffb2430885a6d27397bd0f0c184d2fd456a Mon Sep 17 00:00:00 2001 +From: Stefan Wahren +Date: Thu, 26 Apr 2018 14:49:37 +0200 +Subject: [PATCH 317/321] ARM: bcm_defconfig: Re-enable QCA7000 SPI driver + +Since commit b2f98200c73c ("net: qualcomm: make qca_7k_common a +separate kernel module") the config parameter for the QCA7000 SPI +driver has changed. So re-enable the QCA7000 SPI driver in all +defconfigs, so we can use the qca7000-overlay again. + +Signed-off-by: Stefan Wahren +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + arch/arm64/configs/bcmrpi3_defconfig | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index eba29651e1a5..534a20452f27 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -444,6 +444,7 @@ CONFIG_NETCONSOLE=m + CONFIG_TUN=m + CONFIG_VETH=m + CONFIG_ENC28J60=m ++CONFIG_QCA7000_SPI=m + CONFIG_MDIO_BITBANG=m + CONFIG_PPP=m + CONFIG_PPP_BSDCOMP=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 4c0117e03bcd..2c6c06bf9d4e 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -439,6 +439,7 @@ CONFIG_NETCONSOLE=m + CONFIG_TUN=m + CONFIG_VETH=m + CONFIG_ENC28J60=m ++CONFIG_QCA7000_SPI=m + CONFIG_MDIO_BITBANG=m + CONFIG_PPP=m + CONFIG_PPP_BSDCOMP=m +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index ff5d079c1bbf..a3d3d0cb9253 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -430,6 +430,7 @@ CONFIG_NETCONSOLE=m + CONFIG_TUN=m + CONFIG_VETH=m + CONFIG_ENC28J60=m ++CONFIG_QCA7000_SPI=m + CONFIG_MDIO_BITBANG=m + CONFIG_PPP=m + CONFIG_PPP_BSDCOMP=m +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0318-config-Add-CONFIG_BATTERY_GAUGE_LTC2941-m.patch b/root/target/linux/brcm2708/patches-4.14/0318-config-Add-CONFIG_BATTERY_GAUGE_LTC2941-m.patch new file mode 100644 index 00000000..d897eb83 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0318-config-Add-CONFIG_BATTERY_GAUGE_LTC2941-m.patch @@ -0,0 +1,42 @@ +From 970b642619ff2848e8eba55b49f2ec34fed86651 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 30 Apr 2018 15:57:00 +0100 +Subject: [PATCH 318/321] config: Add CONFIG_BATTERY_GAUGE_LTC2941=m + +Support the LTC294x range of I2C-connected battery monitors. + +See: https://github.com/raspberrypi/linux/issues/2537 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 534a20452f27..67308fdfd3fa 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -648,6 +648,7 @@ CONFIG_W1_SLAVE_DS28E04=m + CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m ++CONFIG_BATTERY_GAUGE_LTC2941=m + CONFIG_HWMON=m + CONFIG_SENSORS_DS1621=m + CONFIG_SENSORS_JC42=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 2c6c06bf9d4e..ed2ddc8d8099 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -641,6 +641,7 @@ CONFIG_W1_SLAVE_DS28E04=m + CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m ++CONFIG_BATTERY_GAUGE_LTC2941=m + CONFIG_HWMON=m + CONFIG_SENSORS_DS1621=m + CONFIG_SENSORS_JC42=m +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0319-overlays-Add-ltc294x-battery-gauge.patch b/root/target/linux/brcm2708/patches-4.14/0319-overlays-Add-ltc294x-battery-gauge.patch new file mode 100644 index 00000000..30d4c7a7 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0319-overlays-Add-ltc294x-battery-gauge.patch @@ -0,0 +1,160 @@ +From 500c619219968b72a9b8bd1f6bd78ff16a7d3ab9 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 1 May 2018 09:35:56 +0100 +Subject: [PATCH 319/321] overlays: Add ltc294x (battery gauge) + +Support the LTC294x range of I2C-connected battery monitors. + +See: https://github.com/raspberrypi/linux/issues/2537 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 25 ++++++++ + arch/arm/boot/dts/overlays/ltc294x-overlay.dts | 86 ++++++++++++++++++++++++++ + 3 files changed, 112 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/ltc294x-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 18cb057ce127..22f7aa2952aa 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -60,6 +60,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + justboom-dac.dtbo \ + justboom-digi.dtbo \ + lirc-rpi.dtbo \ ++ ltc294x.dtbo \ + mbed-dac.dtbo \ + mcp23017.dtbo \ + mcp23s17.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index e00c7e10c2bc..37484904c2d5 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1020,6 +1020,31 @@ Params: gpio_out_pin GPIO for output (default "17") + (default "off") + + ++Name: ltc294x ++Info: Adds support for the ltc294x family of battery gauges ++Load: dtoverlay=ltc294x,= ++Params: ltc2941 Select the ltc2941 device ++ ++ ltc2942 Select the ltc2942 device ++ ++ ltc2943 Select the ltc2943 device ++ ++ ltc2944 Select the ltc2944 device ++ ++ resistor-sense The sense resistor value in milli-ohms. ++ Can be a 32-bit negative value when the battery ++ has been connected to the wrong end of the ++ resistor. ++ ++ prescaler-exponent Range and accuracy of the gauge. The value is ++ programmed into the chip only if it differs ++ from the current setting. ++ For LTC2941 only: ++ - Default value is 128 ++ - the exponent is in the range 0-7 (default 7) ++ See the datasheet for more information. ++ ++ + Name: mbed-dac + Info: Configures the mbed AudioCODEC (TLV320AIC23B) + Load: dtoverlay=mbed-dac +diff --git a/arch/arm/boot/dts/overlays/ltc294x-overlay.dts b/arch/arm/boot/dts/overlays/ltc294x-overlay.dts +new file mode 100644 +index 000000000000..6d971f3649ca +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/ltc294x-overlay.dts +@@ -0,0 +1,86 @@ ++/dts-v1/; ++/plugin/; ++ ++ ++/ { ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ltc2941: ltc2941@64 { ++ compatible = "lltc,ltc2941"; ++ reg = <0x64>; ++ lltc,resistor-sense = <50>; ++ lltc,prescaler-exponent = <7>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ltc2942: ltc2942@64 { ++ compatible = "lltc,ltc2942"; ++ reg = <0x64>; ++ lltc,resistor-sense = <50>; ++ lltc,prescaler-exponent = <7>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ltc2943: ltc2943@64 { ++ compatible = "lltc,ltc2943"; ++ reg = <0x64>; ++ lltc,resistor-sense = <50>; ++ lltc,prescaler-exponent = <7>; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ltc2944: ltc2944@64 { ++ compatible = "lltc,ltc2944"; ++ reg = <0x64>; ++ lltc,resistor-sense = <50>; ++ lltc,prescaler-exponent = <7>; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ ltc2941 = <0>,"+0"; ++ ltc2942 = <0>,"+1"; ++ ltc2943 = <0>,"+2"; ++ ltc2944 = <0>,"+3"; ++ resistor-sense = <<c2941>, "lltc,resistor-sense:0", ++ <<c2942>, "lltc,resistor-sense:0", ++ <<c2943>, "lltc,resistor-sense:0", ++ <<c2944>, "lltc,resistor-sense:0"; ++ prescaler-exponent = <<c2941>, "lltc,prescaler-exponent:0", ++ <<c2942>, "lltc,prescaler-exponent:0", ++ <<c2943>, "lltc,prescaler-exponent:0", ++ <<c2944>, "lltc,prescaler-exponent:0"; ++ }; ++}; +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0320-overlays-Add-support-for-Balena-Fin-board.patch b/root/target/linux/brcm2708/patches-4.14/0320-overlays-Add-support-for-Balena-Fin-board.patch new file mode 100644 index 00000000..3391fc7c --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0320-overlays-Add-support-for-Balena-Fin-board.patch @@ -0,0 +1,131 @@ +From a10aaa00964e6543b3c310fa982d893f468378a8 Mon Sep 17 00:00:00 2001 +From: Florin Sarbu +Date: Mon, 30 Apr 2018 09:11:52 +0200 +Subject: [PATCH 320/321] overlays: Add support for Balena Fin board + +Signed-off-by: Florin Sarbu +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 7 ++ + arch/arm/boot/dts/overlays/balena-fin-overlay.dts | 79 +++++++++++++++++++++++ + 3 files changed, 87 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/balena-fin-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 22f7aa2952aa..a22141d24850 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -17,6 +17,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + audioinjector-addons.dtbo \ + audioinjector-wm8731-audio.dtbo \ + audremap.dtbo \ ++ balena-fin.dtbo \ + bmp085_i2c-sensor.dtbo \ + dht11.dtbo \ + dionaudio-loco.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 37484904c2d5..bea703661027 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -404,6 +404,13 @@ Params: swap_lr Reverse the channel allocation, which will also + (default off) + + ++Name: balena-fin ++Info: Overlay that enables WiFi, Bluetooth and the GPIO expander on the ++ Balena Fin board. ++Load: dtoverlay=balena-fin ++Params: ++ ++ + Name: bmp085_i2c-sensor + Info: This overlay is now deprecated - see i2c-sensor + Load: dtoverlay=bmp085_i2c-sensor +diff --git a/arch/arm/boot/dts/overlays/balena-fin-overlay.dts b/arch/arm/boot/dts/overlays/balena-fin-overlay.dts +new file mode 100644 +index 000000000000..269ab7d72938 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/balena-fin-overlay.dts +@@ -0,0 +1,79 @@ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&mmc>; ++ sdio_wifi: __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio_pins>; ++ bus-width = <4>; ++ brcm,overclock-50 = <35>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ sdio_pins: sdio_pins { ++ brcm,pins = <34 35 36 37 38 39>; ++ brcm,function = <7>; /* ALT3 = SD1 */ ++ brcm,pull = <0 2 2 2 2 2>; ++ }; ++ ++ power_ctrl_pins: power_ctrl_pins { ++ brcm,pins = <40>; ++ brcm,function = <1>; // out ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "/"; ++ __overlay__ { ++ // We should investigate how to switch to mmc-pwrseq-sd8787 ++ // Currently that module requires two GPIOs to function since it ++ // targets a slightly different chip ++ power_ctrl: power_ctrl { ++ compatible = "gpio-poweroff"; ++ gpios = <&gpio 40 1>; ++ force; ++ }; ++ ++ i2c_soft: i2c@0 { ++ compatible = "i2c-gpio"; ++ gpios = <&gpio 43 0 /* sda */ &gpio 42 0 /* scl */>; ++ i2c-gpio,delay-us = <2>; /* ~100 kHz */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c_soft>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ gpio_expander: gpio_expander@20 { ++ compatible = "nxp,pca9554"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ reg = <0x20>; ++ status = "okay"; ++ }; ++ ++ // rtc clock ++ ds1307: ds1307@68 { ++ compatible = "maxim,ds1307"; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++}; +-- +2.16.1 + diff --git a/root/target/linux/brcm2708/patches-4.14/0321-ARM-dts-bcm283x-Fix-DTC-warnings-about-missing-phy-c.patch b/root/target/linux/brcm2708/patches-4.14/0321-ARM-dts-bcm283x-Fix-DTC-warnings-about-missing-phy-c.patch new file mode 100644 index 00000000..cfaf3769 --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.14/0321-ARM-dts-bcm283x-Fix-DTC-warnings-about-missing-phy-c.patch @@ -0,0 +1,31 @@ +From b9094272af9ec751da6fc26a50813e41cd2202c4 Mon Sep 17 00:00:00 2001 +From: Stefan Wahren +Date: Sun, 29 Oct 2017 12:49:05 +0100 +Subject: [PATCH 321/321] ARM: dts: bcm283x: Fix DTC warnings about missing + phy-cells + +commit 014d6da6cb2525d7f48fb08c705cb130cc7b5f4a upstream. + +This patch fixes the DTC warnings about missing property #phy-cells. + +Signed-off-by: Stefan Wahren +Signed-off-by: Eric Anholt +Reviewed-by: Eric Anholt +--- + arch/arm/boot/dts/bcm283x.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi +index 013431e3d7c3..dcde93c85c2d 100644 +--- a/arch/arm/boot/dts/bcm283x.dtsi ++++ b/arch/arm/boot/dts/bcm283x.dtsi +@@ -639,5 +639,6 @@ + + usbphy: phy { + compatible = "usb-nop-xceiv"; ++ #phy-cells = <0>; + }; + }; +-- +2.16.1 +