ARM: pxa: use pdev resource for palmld mmio
authorArnd Bergmann <arnd@arndb.de>
Wed, 11 Sep 2019 07:36:03 +0000 (09:36 +0200)
committerArnd Bergmann <arnd@arndb.de>
Wed, 20 Apr 2022 11:29:34 +0000 (13:29 +0200)
The palmld header is almost unused in drivers, the only
remaining thing now is the PATA device address, which should
really be passed as a resource.

Cc: linux-ide@vger.kernel.org
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-pxa/include/mach/palmld.h [deleted file]
arch/arm/mach-pxa/palmld-pcmcia.c
arch/arm/mach-pxa/palmld.c
arch/arm/mach-pxa/palmld.h [new file with mode: 0644]
drivers/ata/pata_palmld.c

diff --git a/arch/arm/mach-pxa/include/mach/palmld.h b/arch/arm/mach-pxa/include/mach/palmld.h
deleted file mode 100644 (file)
index 99a6d8b..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * GPIOs and interrupts for Palm LifeDrive Handheld Computer
- *
- * Authors:    Alex Osborne <ato@meshy.org>
- *             Marek Vasut <marek.vasut@gmail.com>
- */
-
-#ifndef _INCLUDE_PALMLD_H_
-#define _INCLUDE_PALMLD_H_
-
-#include "irqs.h" /* PXA_GPIO_TO_IRQ */
-
-/** HERE ARE GPIOs **/
-
-/* GPIOs */
-#define GPIO_NR_PALMLD_GPIO_RESET      1
-#define GPIO_NR_PALMLD_POWER_DETECT    4
-#define GPIO_NR_PALMLD_HOTSYNC_BUTTON_N        10
-#define GPIO_NR_PALMLD_POWER_SWITCH    12
-#define GPIO_NR_PALMLD_EARPHONE_DETECT         13
-#define GPIO_NR_PALMLD_LOCK_SWITCH     15
-
-/* SD/MMC */
-#define GPIO_NR_PALMLD_SD_DETECT_N     14
-#define GPIO_NR_PALMLD_SD_POWER                114
-#define GPIO_NR_PALMLD_SD_READONLY     116
-
-/* TOUCHSCREEN */
-#define GPIO_NR_PALMLD_WM9712_IRQ      27
-
-/* IRDA */
-#define GPIO_NR_PALMLD_IR_DISABLE      108
-
-/* LCD/BACKLIGHT */
-#define GPIO_NR_PALMLD_BL_POWER                19
-#define GPIO_NR_PALMLD_LCD_POWER       96
-
-/* LCD BORDER */
-#define GPIO_NR_PALMLD_BORDER_SWITCH   21
-#define GPIO_NR_PALMLD_BORDER_SELECT   22
-
-/* BLUETOOTH */
-#define GPIO_NR_PALMLD_BT_POWER                17
-#define GPIO_NR_PALMLD_BT_RESET                83
-
-/* PCMCIA (WiFi) */
-#define GPIO_NR_PALMLD_PCMCIA_READY    38
-#define GPIO_NR_PALMLD_PCMCIA_POWER    36
-#define GPIO_NR_PALMLD_PCMCIA_RESET    81
-
-/* LEDs */
-#define GPIO_NR_PALMLD_LED_GREEN       52
-#define GPIO_NR_PALMLD_LED_AMBER       94
-
-/* IDE */
-#define GPIO_NR_PALMLD_IDE_RESET       98
-#define GPIO_NR_PALMLD_IDE_PWEN                115
-
-/* USB */
-#define GPIO_NR_PALMLD_USB_DETECT_N    3
-#define GPIO_NR_PALMLD_USB_READY       86
-#define GPIO_NR_PALMLD_USB_RESET       88
-#define GPIO_NR_PALMLD_USB_INT         106
-#define GPIO_NR_PALMLD_USB_POWER       118
-/* 20, 53 and 86 are usb related too */
-
-/* INTERRUPTS */
-#define IRQ_GPIO_PALMLD_GPIO_RESET     PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_GPIO_RESET)
-#define IRQ_GPIO_PALMLD_SD_DETECT_N    PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_SD_DETECT_N)
-#define IRQ_GPIO_PALMLD_WM9712_IRQ     PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_WM9712_IRQ)
-#define IRQ_GPIO_PALMLD_IDE_IRQ                PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_IDE_IRQ)
-
-
-/** HERE ARE INIT VALUES **/
-
-/* IO mappings */
-#define PALMLD_USB_PHYS                PXA_CS2_PHYS
-#define PALMLD_USB_VIRT                0xf0000000
-#define PALMLD_USB_SIZE                0x00100000
-
-#define PALMLD_IDE_PHYS                0x20000000
-#define PALMLD_IDE_VIRT                0xf1000000
-#define PALMLD_IDE_SIZE                0x00100000
-
-#define PALMLD_PHYS_IO_START   0x40000000
-#define PALMLD_STR_BASE                0xa0200000
-
-/* BATTERY */
-#define PALMLD_BAT_MAX_VOLTAGE         4000    /* 4.00V maximum voltage */
-#define PALMLD_BAT_MIN_VOLTAGE         3550    /* 3.55V critical voltage */
-#define PALMLD_BAT_MAX_CURRENT         0       /* unknown */
-#define PALMLD_BAT_MIN_CURRENT         0       /* unknown */
-#define PALMLD_BAT_MAX_CHARGE          1       /* unknown */
-#define PALMLD_BAT_MIN_CHARGE          1       /* unknown */
-#define PALMLD_MAX_LIFE_MINS           240     /* on-life in minutes */
-
-#define PALMLD_BAT_MEASURE_DELAY       (HZ * 1)
-
-/* BACKLIGHT */
-#define PALMLD_MAX_INTENSITY           0xFE
-#define PALMLD_DEFAULT_INTENSITY       0x7E
-#define PALMLD_LIMIT_MASK              0x7F
-#define PALMLD_PRESCALER               0x3F
-#define PALMLD_PERIOD_NS               3500
-
-#endif
index 07e0f7438db183e6ffb3b5bea3adef418bf4bb4b..720294a50864dd12af69c374a2c8fe6feffabeaf 100644 (file)
 #include <linux/gpio.h>
 
 #include <asm/mach-types.h>
-#include <mach/palmld.h>
 #include <pcmcia/soc_common.h>
 
+#include "palmld.h"
+
 static struct gpio palmld_pcmcia_gpios[] = {
        { GPIO_NR_PALMLD_PCMCIA_POWER,  GPIOF_INIT_LOW, "PCMCIA Power" },
        { GPIO_NR_PALMLD_PCMCIA_RESET,  GPIOF_INIT_HIGH,"PCMCIA Reset" },
index d85146957004c928d13468abd748679221229846..d821606ce0b503b4401a912dfb1095f9022e01ae 100644 (file)
@@ -29,8 +29,8 @@
 #include <asm/mach/map.h>
 
 #include "pxa27x.h"
+#include "palmld.h"
 #include <linux/platform_data/asoc-pxa.h>
-#include <mach/palmld.h>
 #include <linux/platform_data/mmc-pxamci.h>
 #include <linux/platform_data/video-pxafb.h>
 #include <linux/platform_data/irda-pxaficp.h>
@@ -279,9 +279,15 @@ static inline void palmld_leds_init(void) {}
  * HDD
  ******************************************************************************/
 #if defined(CONFIG_PATA_PALMLD) || defined(CONFIG_PATA_PALMLD_MODULE)
+static struct resource palmld_ide_resources[] = {
+       DEFINE_RES_MEM(PALMLD_IDE_PHYS, 0x1000),
+};
+
 static struct platform_device palmld_ide_device = {
-       .name   = "pata_palmld",
-       .id     = -1,
+       .name           = "pata_palmld",
+       .id             = -1,
+       .resource       = palmld_ide_resources,
+       .num_resources  = ARRAY_SIZE(palmld_ide_resources),
 };
 
 static struct gpiod_lookup_table palmld_ide_gpio_table = {
diff --git a/arch/arm/mach-pxa/palmld.h b/arch/arm/mach-pxa/palmld.h
new file mode 100644 (file)
index 0000000..ee3bc15
--- /dev/null
@@ -0,0 +1,107 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * GPIOs and interrupts for Palm LifeDrive Handheld Computer
+ *
+ * Authors:    Alex Osborne <ato@meshy.org>
+ *             Marek Vasut <marek.vasut@gmail.com>
+ */
+
+#ifndef _INCLUDE_PALMLD_H_
+#define _INCLUDE_PALMLD_H_
+
+#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */
+
+/** HERE ARE GPIOs **/
+
+/* GPIOs */
+#define GPIO_NR_PALMLD_GPIO_RESET      1
+#define GPIO_NR_PALMLD_POWER_DETECT    4
+#define GPIO_NR_PALMLD_HOTSYNC_BUTTON_N        10
+#define GPIO_NR_PALMLD_POWER_SWITCH    12
+#define GPIO_NR_PALMLD_EARPHONE_DETECT         13
+#define GPIO_NR_PALMLD_LOCK_SWITCH     15
+
+/* SD/MMC */
+#define GPIO_NR_PALMLD_SD_DETECT_N     14
+#define GPIO_NR_PALMLD_SD_POWER                114
+#define GPIO_NR_PALMLD_SD_READONLY     116
+
+/* TOUCHSCREEN */
+#define GPIO_NR_PALMLD_WM9712_IRQ      27
+
+/* IRDA */
+#define GPIO_NR_PALMLD_IR_DISABLE      108
+
+/* LCD/BACKLIGHT */
+#define GPIO_NR_PALMLD_BL_POWER                19
+#define GPIO_NR_PALMLD_LCD_POWER       96
+
+/* LCD BORDER */
+#define GPIO_NR_PALMLD_BORDER_SWITCH   21
+#define GPIO_NR_PALMLD_BORDER_SELECT   22
+
+/* BLUETOOTH */
+#define GPIO_NR_PALMLD_BT_POWER                17
+#define GPIO_NR_PALMLD_BT_RESET                83
+
+/* PCMCIA (WiFi) */
+#define GPIO_NR_PALMLD_PCMCIA_READY    38
+#define GPIO_NR_PALMLD_PCMCIA_POWER    36
+#define GPIO_NR_PALMLD_PCMCIA_RESET    81
+
+/* LEDs */
+#define GPIO_NR_PALMLD_LED_GREEN       52
+#define GPIO_NR_PALMLD_LED_AMBER       94
+
+/* IDE */
+#define GPIO_NR_PALMLD_IDE_RESET       98
+#define GPIO_NR_PALMLD_IDE_PWEN                115
+
+/* USB */
+#define GPIO_NR_PALMLD_USB_DETECT_N    3
+#define GPIO_NR_PALMLD_USB_READY       86
+#define GPIO_NR_PALMLD_USB_RESET       88
+#define GPIO_NR_PALMLD_USB_INT         106
+#define GPIO_NR_PALMLD_USB_POWER       118
+/* 20, 53 and 86 are usb related too */
+
+/* INTERRUPTS */
+#define IRQ_GPIO_PALMLD_GPIO_RESET     PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_GPIO_RESET)
+#define IRQ_GPIO_PALMLD_SD_DETECT_N    PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_SD_DETECT_N)
+#define IRQ_GPIO_PALMLD_WM9712_IRQ     PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_WM9712_IRQ)
+#define IRQ_GPIO_PALMLD_IDE_IRQ                PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_IDE_IRQ)
+
+
+/** HERE ARE INIT VALUES **/
+
+/* IO mappings */
+#define PALMLD_USB_PHYS                PXA_CS2_PHYS
+#define PALMLD_USB_VIRT                0xf0000000
+#define PALMLD_USB_SIZE                0x00100000
+
+#define PALMLD_IDE_PHYS                0x20000000
+#define PALMLD_IDE_VIRT                0xf1000000
+#define PALMLD_IDE_SIZE                0x00100000
+
+#define PALMLD_PHYS_IO_START   0x40000000
+#define PALMLD_STR_BASE                0xa0200000
+
+/* BATTERY */
+#define PALMLD_BAT_MAX_VOLTAGE         4000    /* 4.00V maximum voltage */
+#define PALMLD_BAT_MIN_VOLTAGE         3550    /* 3.55V critical voltage */
+#define PALMLD_BAT_MAX_CURRENT         0       /* unknown */
+#define PALMLD_BAT_MIN_CURRENT         0       /* unknown */
+#define PALMLD_BAT_MAX_CHARGE          1       /* unknown */
+#define PALMLD_BAT_MIN_CHARGE          1       /* unknown */
+#define PALMLD_MAX_LIFE_MINS           240     /* on-life in minutes */
+
+#define PALMLD_BAT_MEASURE_DELAY       (HZ * 1)
+
+/* BACKLIGHT */
+#define PALMLD_MAX_INTENSITY           0xFE
+#define PALMLD_DEFAULT_INTENSITY       0x7E
+#define PALMLD_LIMIT_MASK              0x7F
+#define PALMLD_PRESCALER               0x3F
+#define PALMLD_PERIOD_NS               3500
+
+#endif
index 2448441571ed64fb5d031edf1bab5d5a995c816c..400e65190904fd04868871df36491b36de53fa00 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/gpio/consumer.h>
 
 #include <scsi/scsi_host.h>
-#include <mach/palmld.h>
 
 #define DRV_NAME "pata_palmld"
 
@@ -63,7 +62,7 @@ static int palmld_pata_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        /* remap drive's physical memory address */
-       mem = devm_ioremap(dev, PALMLD_IDE_PHYS, 0x1000);
+       mem = devm_platform_ioremap_resource(pdev, 0);
        if (!mem)
                return -ENOMEM;