From 2fe256495cbc7cc477d67fe5de5693884e8591b6 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Thu, 23 Apr 2015 00:26:47 +0200 Subject: linux-handheld_4.0: add ipaq h1940 patches and defconfig Patches provided and tested by Vasily Khoruzhick Signed-off-by: Vasily Khoruzhick Signed-off-by: Andrea Adami --- .../h1940/0001-rfkill-add-IR-type.patch | 59 ++++++ ...4xx-add-dma_coherent_mask-for-DMA-devices.patch | 35 ++++ ...s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch | 34 ++++ ...xx-drop-RFKILL-driver-for-H1940-bluetooth.patch | 202 +++++++++++++++++++++ .../0005-ARM-s3c24xx-h1940-Add-nand-device.patch | 121 ++++++++++++ ...006-ARM-s3c24xx-h1940-don-t-touch-UPLLCON.patch | 41 +++++ ...007-ARM-s3c24xx-h1940-unlock-reset-button.patch | 52 ++++++ ...s3c24xx-h1940-increase-oversampling-shift.patch | 29 +++ .../0009-ARM-s3c24xx-h1940-Add-DMA-device.patch | 27 +++ ...3c24xx-h1940-add-bluetooth-RF-kill-switch.patch | 107 +++++++++++ .../0011-ARM-s3c24xx-h1940-add-IR-switch.patch | 76 ++++++++ ...3c24xx-ADC-port-to-common-clock-framework.patch | 37 ++++ ...-H1940-Move-gpiochip_add-call-into-core_i.patch | 38 ++++ ...-fix-oops-in-suspend-callback-for-non-dt-.patch | 28 +++ ...0-Avoid-accessing-i2c-bus-when-codec-is-d.patch | 31 ++++ .../linux/linux-handheld-4.0/h1940/defconfig | 200 ++++++++++++++++++++ recipes-kernel/linux/linux-handheld_4.0.bb | 21 ++- 17 files changed, 1137 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0001-rfkill-add-IR-type.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0002-ARM-s3c24xx-add-dma_coherent_mask-for-DMA-devices.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0003-ARM-s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0004-ARM-s3c24xx-drop-RFKILL-driver-for-H1940-bluetooth.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0005-ARM-s3c24xx-h1940-Add-nand-device.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0006-ARM-s3c24xx-h1940-don-t-touch-UPLLCON.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0007-ARM-s3c24xx-h1940-unlock-reset-button.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0008-ARM-s3c24xx-h1940-increase-oversampling-shift.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0009-ARM-s3c24xx-h1940-Add-DMA-device.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0010-ARM-s3c24xx-h1940-add-bluetooth-RF-kill-switch.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0011-ARM-s3c24xx-h1940-add-IR-switch.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0012-ARM-s3c24xx-ADC-port-to-common-clock-framework.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0013-ARM-s3c24xx-H1940-Move-gpiochip_add-call-into-core_i.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0014-i2c-s3c2410-fix-oops-in-suspend-callback-for-non-dt-.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/0015-ASoC-uda1380-Avoid-accessing-i2c-bus-when-codec-is-d.patch create mode 100644 recipes-kernel/linux/linux-handheld-4.0/h1940/defconfig (limited to 'recipes-kernel') diff --git a/recipes-kernel/linux/linux-handheld-4.0/h1940/0001-rfkill-add-IR-type.patch b/recipes-kernel/linux/linux-handheld-4.0/h1940/0001-rfkill-add-IR-type.patch new file mode 100644 index 0000000..bc2b855 --- /dev/null +++ b/recipes-kernel/linux/linux-handheld-4.0/h1940/0001-rfkill-add-IR-type.patch @@ -0,0 +1,59 @@ +From 332ef0e6aaf772b94cceb46b26fec393e829efa0 Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Thu, 17 Oct 2013 12:19:47 +0300 +Subject: [PATCH 01/15] rfkill: add IR type + +Infrared receivers/transmitters can also be disabled, +so add IR type to rfkill subsystem + +Signed-off-by: Vasily Khoruzhick +--- + include/uapi/linux/rfkill.h | 2 ++ + net/rfkill/core.c | 4 +++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/include/uapi/linux/rfkill.h b/include/uapi/linux/rfkill.h +index 058757f..d4ae526 100644 +--- a/include/uapi/linux/rfkill.h ++++ b/include/uapi/linux/rfkill.h +@@ -38,6 +38,7 @@ + * @RFKILL_TYPE_GPS: switch is on a GPS device. + * @RFKILL_TYPE_FM: switch is on a FM radio device. + * @RFKILL_TYPE_NFC: switch is on an NFC device. ++ * @RFKILL_TYPE_IR: switch is on an IR device. + * @NUM_RFKILL_TYPES: number of defined rfkill types + */ + enum rfkill_type { +@@ -50,6 +51,7 @@ enum rfkill_type { + RFKILL_TYPE_GPS, + RFKILL_TYPE_FM, + RFKILL_TYPE_NFC, ++ RFKILL_TYPE_IR, + NUM_RFKILL_TYPES, + }; + +diff --git a/net/rfkill/core.c b/net/rfkill/core.c +index fa7cd79..62f90fa 100644 +--- a/net/rfkill/core.c ++++ b/net/rfkill/core.c +@@ -585,7 +585,7 @@ static DEVICE_ATTR_RO(name); + + static const char *rfkill_get_type_str(enum rfkill_type type) + { +- BUILD_BUG_ON(NUM_RFKILL_TYPES != RFKILL_TYPE_NFC + 1); ++ BUILD_BUG_ON(NUM_RFKILL_TYPES != RFKILL_TYPE_IR + 1); + + switch (type) { + case RFKILL_TYPE_WLAN: +@@ -604,6 +604,8 @@ static const char *rfkill_get_type_str(enum rfkill_type type) + return "fm"; + case RFKILL_TYPE_NFC: + return "nfc"; ++ case RFKILL_TYPE_IR: ++ return "ir"; + default: + BUG(); + } +-- +2.3.5 + diff --git a/recipes-kernel/linux/linux-handheld-4.0/h1940/0002-ARM-s3c24xx-add-dma_coherent_mask-for-DMA-devices.patch b/recipes-kernel/linux/linux-handheld-4.0/h1940/0002-ARM-s3c24xx-add-dma_coherent_mask-for-DMA-devices.patch new file mode 100644 index 0000000..93dbb1c --- /dev/null +++ b/recipes-kernel/linux/linux-handheld-4.0/h1940/0002-ARM-s3c24xx-add-dma_coherent_mask-for-DMA-devices.patch @@ -0,0 +1,35 @@ +From 22ea8a2a006bc62235d25dacfc5e51dfa4db9e53 Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Sun, 18 May 2014 12:44:52 +0300 +Subject: [PATCH 02/15] ARM: s3c24xx: add dma_coherent_mask for DMA devices + +Otherwise dma_alloc_coherent() fails. + +Signed-off-by: Vasily Khoruzhick +--- + arch/arm/mach-s3c24xx/common.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c +index bf50328..7ed0853 100644 +--- a/arch/arm/mach-s3c24xx/common.c ++++ b/arch/arm/mach-s3c24xx/common.c +@@ -355,6 +355,7 @@ struct platform_device s3c2410_device_dma = { + .resource = s3c2410_dma_resource, + .dev = { + .platform_data = &s3c2410_dma_platdata, ++ .coherent_dma_mask = ~0, + }, + }; + #endif +@@ -452,6 +453,7 @@ struct platform_device s3c2440_device_dma = { + .resource = s3c2410_dma_resource, + .dev = { + .platform_data = &s3c2440_dma_platdata, ++ .coherent_dma_mask = ~0, + }, + }; + #endif +-- +2.3.5 + diff --git a/recipes-kernel/linux/linux-handheld-4.0/h1940/0003-ARM-s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch b/recipes-kernel/linux/linux-handheld-4.0/h1940/0003-ARM-s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch new file mode 100644 index 0000000..829181e --- /dev/null +++ b/recipes-kernel/linux/linux-handheld-4.0/h1940/0003-ARM-s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch @@ -0,0 +1,34 @@ +From 95a5c5066e062d919aa7f07bf3727b5825d2fe71 Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Sun, 18 May 2014 12:45:39 +0300 +Subject: [PATCH 03/15] ARM: s3c24xx: Add DMA resources for SDI and I2S + +Signed-off-by: Vasily Khoruzhick +--- + arch/arm/plat-samsung/devs.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c +index 83c7d15..62edcab 100644 +--- a/arch/arm/plat-samsung/devs.c ++++ b/arch/arm/plat-samsung/devs.c +@@ -564,6 +564,8 @@ void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd) + #ifdef CONFIG_PLAT_S3C24XX + static struct resource s3c_iis_resource[] = { + [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS), ++ [1] = DEFINE_RES_DMA(DMACH_I2S_OUT), ++ [2] = DEFINE_RES_DMA(DMACH_I2S_IN), + }; + + struct platform_device s3c_device_iis = { +@@ -863,6 +865,7 @@ struct platform_device s3c_device_rtc = { + static struct resource s3c_sdi_resource[] = { + [0] = DEFINE_RES_MEM(S3C24XX_PA_SDI, S3C24XX_SZ_SDI), + [1] = DEFINE_RES_IRQ(IRQ_SDI), ++ [2] = DEFINE_RES_DMA(DMACH_SDI), + }; + + struct platform_device s3c_device_sdi = { +-- +2.3.5 + diff --git a/recipes-kernel/linux/linux-handheld-4.0/h1940/0004-ARM-s3c24xx-drop-RFKILL-driver-for-H1940-bluetooth.patch b/recipes-kernel/linux/linux-handheld-4.0/h1940/0004-ARM-s3c24xx-drop-RFKILL-driver-for-H1940-bluetooth.patch new file mode 100644 index 0000000..30bc380 --- /dev/null +++ b/recipes-kernel/linux/linux-handheld-4.0/h1940/0004-ARM-s3c24xx-drop-RFKILL-driver-for-H1940-bluetooth.patch @@ -0,0 +1,202 @@ +From 8c0f1380edceb7de9b006ad96780394ed6bca884 Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Thu, 17 Oct 2013 12:09:19 +0300 +Subject: [PATCH 04/15] ARM: s3c24xx: drop RFKILL driver for H1940 bluetooth + +rfkill-gpio can do it's job easily. + +Signed-off-by: Vasily Khoruzhick +--- + arch/arm/mach-s3c24xx/Kconfig | 8 -- + arch/arm/mach-s3c24xx/Makefile | 1 - + arch/arm/mach-s3c24xx/h1940-bluetooth.c | 147 -------------------------------- + 3 files changed, 156 deletions(-) + delete mode 100644 arch/arm/mach-s3c24xx/h1940-bluetooth.c + +diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig +index 79c49ff..cc0474f 100644 +--- a/arch/arm/mach-s3c24xx/Kconfig ++++ b/arch/arm/mach-s3c24xx/Kconfig +@@ -220,14 +220,6 @@ config ARCH_H1940 + help + Say Y here if you are using the HP IPAQ H1940 + +-config H1940BT +- tristate "Control the state of H1940 bluetooth chip" +- depends on ARCH_H1940 +- select RFKILL +- help +- This is a simple driver that is able to control +- the state of built in bluetooth chip on h1940. +- + config PM_H1940 + bool + help +diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile +index b40a22f..8f6e809 100644 +--- a/arch/arm/mach-s3c24xx/Makefile ++++ b/arch/arm/mach-s3c24xx/Makefile +@@ -50,7 +50,6 @@ obj-$(CONFIG_MACH_AML_M5900) += mach-amlm5900.o + obj-$(CONFIG_ARCH_BAST) += mach-bast.o + obj-$(CONFIG_BAST_PC104_IRQ) += bast-irq.o + obj-$(CONFIG_ARCH_H1940) += mach-h1940.o +-obj-$(CONFIG_H1940BT) += h1940-bluetooth.o + obj-$(CONFIG_PM_H1940) += pm-h1940.o + obj-$(CONFIG_MACH_N30) += mach-n30.o + obj-$(CONFIG_MACH_OTOM) += mach-otom.o +diff --git a/arch/arm/mach-s3c24xx/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c +deleted file mode 100644 +index 9c8b127..0000000 +--- a/arch/arm/mach-s3c24xx/h1940-bluetooth.c ++++ /dev/null +@@ -1,147 +0,0 @@ +-/* +- * arch/arm/mach-s3c2410/h1940-bluetooth.c +- * Copyright (c) Arnaud Patard +- * +- * This file is subject to the terms and conditions of the GNU General Public +- * License. See the file COPYING in the main directory of this archive for +- * more details. +- * +- * S3C2410 bluetooth "driver" +- * +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-#include "h1940.h" +- +-#define DRV_NAME "h1940-bt" +- +-/* Bluetooth control */ +-static void h1940bt_enable(int on) +-{ +- if (on) { +- /* Power on the chip */ +- gpio_set_value(H1940_LATCH_BLUETOOTH_POWER, 1); +- /* Reset the chip */ +- mdelay(10); +- +- gpio_set_value(S3C2410_GPH(1), 1); +- mdelay(10); +- gpio_set_value(S3C2410_GPH(1), 0); +- +- h1940_led_blink_set(NULL, GPIO_LED_BLINK, NULL, NULL); +- } +- else { +- gpio_set_value(S3C2410_GPH(1), 1); +- mdelay(10); +- gpio_set_value(S3C2410_GPH(1), 0); +- mdelay(10); +- gpio_set_value(H1940_LATCH_BLUETOOTH_POWER, 0); +- +- h1940_led_blink_set(NULL, GPIO_LED_NO_BLINK_LOW, NULL, NULL); +- } +-} +- +-static int h1940bt_set_block(void *data, bool blocked) +-{ +- h1940bt_enable(!blocked); +- return 0; +-} +- +-static const struct rfkill_ops h1940bt_rfkill_ops = { +- .set_block = h1940bt_set_block, +-}; +- +-static int h1940bt_probe(struct platform_device *pdev) +-{ +- struct rfkill *rfk; +- int ret = 0; +- +- ret = gpio_request(S3C2410_GPH(1), dev_name(&pdev->dev)); +- if (ret) { +- dev_err(&pdev->dev, "could not get GPH1\n"); +- return ret; +- } +- +- ret = gpio_request(H1940_LATCH_BLUETOOTH_POWER, dev_name(&pdev->dev)); +- if (ret) { +- gpio_free(S3C2410_GPH(1)); +- dev_err(&pdev->dev, "could not get BT_POWER\n"); +- return ret; +- } +- +- /* Configures BT serial port GPIOs */ +- s3c_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); +- s3c_gpio_setpull(S3C2410_GPH(0), S3C_GPIO_PULL_NONE); +- s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT); +- s3c_gpio_setpull(S3C2410_GPH(1), S3C_GPIO_PULL_NONE); +- s3c_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0); +- s3c_gpio_setpull(S3C2410_GPH(2), S3C_GPIO_PULL_NONE); +- s3c_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); +- s3c_gpio_setpull(S3C2410_GPH(3), S3C_GPIO_PULL_NONE); +- +- rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH, +- &h1940bt_rfkill_ops, NULL); +- if (!rfk) { +- ret = -ENOMEM; +- goto err_rfk_alloc; +- } +- +- ret = rfkill_register(rfk); +- if (ret) +- goto err_rfkill; +- +- platform_set_drvdata(pdev, rfk); +- +- return 0; +- +-err_rfkill: +- rfkill_destroy(rfk); +-err_rfk_alloc: +- return ret; +-} +- +-static int h1940bt_remove(struct platform_device *pdev) +-{ +- struct rfkill *rfk = platform_get_drvdata(pdev); +- +- platform_set_drvdata(pdev, NULL); +- gpio_free(S3C2410_GPH(1)); +- +- if (rfk) { +- rfkill_unregister(rfk); +- rfkill_destroy(rfk); +- } +- rfk = NULL; +- +- h1940bt_enable(0); +- +- return 0; +-} +- +- +-static struct platform_driver h1940bt_driver = { +- .driver = { +- .name = DRV_NAME, +- }, +- .probe = h1940bt_probe, +- .remove = h1940bt_remove, +-}; +- +-module_platform_driver(h1940bt_driver); +- +-MODULE_AUTHOR("Arnaud Patard "); +-MODULE_DESCRIPTION("Driver for the iPAQ H1940 bluetooth chip"); +-MODULE_LICENSE("GPL"); +-- +2.3.5 + diff --git a/recipes-kernel/linux/linux-handheld-4.0/h1940/0005-ARM-s3c24xx-h1940-Add-nand-device.patch b/recipes-kernel/linux/linux-handheld-4.0/h1940/0005-ARM-s3c24xx-h1940-Add-nand-device.patch new file mode 100644 index 0000000..5a7f6e3 --- /dev/null +++ b/recipes-kernel/linux/linux-handheld-4.0/h1940/0005-ARM-s3c24xx-h1940-Add-nand-device.patch @@ -0,0 +1,121 @@ +From 8ea33d882cda31e97a2dd17e635c45434cc69bdd Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Thu, 17 Oct 2013 12:13:29 +0300 +Subject: [PATCH 05/15] ARM: s3c24xx: h1940: Add nand device + +Signed-off-by: Vasily Khoruzhick +--- + arch/arm/mach-s3c24xx/mach-h1940.c | 69 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 69 insertions(+) + +diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c +index d40d4f5..bdb99e5 100644 +--- a/arch/arm/mach-s3c24xx/mach-h1940.c ++++ b/arch/arm/mach-s3c24xx/mach-h1940.c +@@ -32,6 +32,9 @@ + #include + #include + ++#include ++#include ++ + #include