ata: rb532_cf: Convert to use GPIO descriptors

Pass a GPIO descriptor for the device instead of a hardcoded
GPIO number from the global GPIO numberspace. Use gpio
descriptors throughout.

Cut the now completely unused platform data for the CF slot.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Waldemar Brodkorb <wbx@openadk.org>
Cc: Matt Redfearn <matt.redfearn@mips.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Linus Walleij
2018-11-20 08:47:32 +01:00
committed by Jens Axboe
parent 83a7faace1
commit cd56f35e52
3 changed files with 19 additions and 44 deletions

View File

@@ -23,6 +23,7 @@
#include <linux/mtd/platnand.h>
#include <linux/mtd/mtd.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <linux/serial_8250.h>
@@ -127,14 +128,18 @@ static struct resource cf_slot0_res[] = {
}
};
static struct cf_device cf_slot0_data = {
.gpio_pin = CF_GPIO_NUM
static struct gpiod_lookup_table cf_slot0_gpio_table = {
.dev_id = "pata-rb532-cf",
.table = {
GPIO_LOOKUP("gpio0", CF_GPIO_NUM,
NULL, GPIO_ACTIVE_HIGH),
{ },
},
};
static struct platform_device cf_slot0 = {
.id = -1,
.name = "pata-rb532-cf",
.dev.platform_data = &cf_slot0_data,
.resource = cf_slot0_res,
.num_resources = ARRAY_SIZE(cf_slot0_res),
};
@@ -305,6 +310,7 @@ static int __init plat_setup_devices(void)
dev_set_drvdata(&korina_dev0.dev, &korina_dev0_data);
gpiod_add_lookup_table(&cf_slot0_gpio_table);
return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs));
}