OMAP-GPMC: driver updates for v4.8

* Make GPMC driver non modular as it is going to
 be built-in only till arch/arm/mach-omap2 users
 are removed.
 
 * Fix build if CONFIG_OF is not defined.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXcOJDAAoJENJaa9O+djCTMDYP/jurhmkQ+5AtQDkBiizbKiHD
 I11YApN9hRvfZFf3rh8+dwSNswQI/ND3foCdvN6D+TPTYPlEV06hjCygxPlqN+ui
 3cpBn0mG6ZKFuVkz5HIQwYdy9t+zn5HULT+JkPCkRRwFUBQys/Cm/UlkBQZQzgJC
 H4f+Rk81NoKY4LMeKAXweYoYA1y4LosgBX74THAd8zRSIGeVSuXGFFFCr49W+LTd
 /L4LxJxLy1UIj/8oMRMhYerCZuDIA4AftgW93pnLiqJ9Whoo9tASfw88VJw6wsle
 2JA5ZdNKw6I3/FAzsXGmWqcfviZaBdIHulrIiPhWz2sAonsUToz4tBIyNGDLHMra
 Z7bXf0iNIoxWXC4ClSoKfADm/Ooijti4f1+d4FbI1urhSC3RWzz/YH2KLccDetwR
 YJs3jrzVH409asTtk7qmFl/rA2dgvjhW68Cp0EDPvBpJlEtQlss4kzll3+7/z/VZ
 urRweA6SjaNgmpuJVbxjOE1DNzmPqglm1s6laAGQdCEC/CVwyjbF7ReUNLCRzYzD
 sgx6sEDNCfckwmYw+u3QUV4oiHwTMLSvfeNh6Lnoj1HTUg9KEVUT12ji17b8zEA7
 OaanLm9mHJWxt59l96xJO7LXAjF0BVatEYdxcY7ul9a87SgXdpKSM2XcRMRxImb4
 21M0qhhtHui2ukg5DBcY
 =8acM
 -----END PGP SIGNATURE-----

Merge tag 'gpmc-omap-for-v4.8' of https://github.com/rogerq/linux into next/drivers

OMAP-GPMC: driver updates for v4.8

* Make GPMC driver non modular as it is going to
be built-in only till arch/arm/mach-omap2 users
are removed.

* Fix build if CONFIG_OF is not defined.

* tag 'gpmc-omap-for-v4.8' of https://github.com/rogerq/linux:
  memory: omap-gpmc: Move gpio functions out of #ifdef CONFIG_OF
  memory: omap-gpmc: make it explicitly non-modular

Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2016-07-04 22:20:25 -07:00
commit 9419491eda

View File

@ -20,7 +20,6 @@
#include <linux/ioport.h>
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/irqdomain.h>
@ -1807,7 +1806,6 @@ static const struct of_device_id gpmc_dt_ids[] = {
{ .compatible = "ti,am3352-gpmc" }, /* am335x devices */
{ }
};
MODULE_DEVICE_TABLE(of, gpmc_dt_ids);
/**
* gpmc_read_settings_dt - read gpmc settings from device-tree
@ -2155,68 +2153,6 @@ err:
return ret;
}
static int gpmc_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
{
return 1; /* we're input only */
}
static int gpmc_gpio_direction_input(struct gpio_chip *chip,
unsigned int offset)
{
return 0; /* we're input only */
}
static int gpmc_gpio_direction_output(struct gpio_chip *chip,
unsigned int offset, int value)
{
return -EINVAL; /* we're input only */
}
static void gpmc_gpio_set(struct gpio_chip *chip, unsigned int offset,
int value)
{
}
static int gpmc_gpio_get(struct gpio_chip *chip, unsigned int offset)
{
u32 reg;
offset += 8;
reg = gpmc_read_reg(GPMC_STATUS) & BIT(offset);
return !!reg;
}
static int gpmc_gpio_init(struct gpmc_device *gpmc)
{
int ret;
gpmc->gpio_chip.parent = gpmc->dev;
gpmc->gpio_chip.owner = THIS_MODULE;
gpmc->gpio_chip.label = DEVICE_NAME;
gpmc->gpio_chip.ngpio = gpmc_nr_waitpins;
gpmc->gpio_chip.get_direction = gpmc_gpio_get_direction;
gpmc->gpio_chip.direction_input = gpmc_gpio_direction_input;
gpmc->gpio_chip.direction_output = gpmc_gpio_direction_output;
gpmc->gpio_chip.set = gpmc_gpio_set;
gpmc->gpio_chip.get = gpmc_gpio_get;
gpmc->gpio_chip.base = -1;
ret = gpiochip_add(&gpmc->gpio_chip);
if (ret < 0) {
dev_err(gpmc->dev, "could not register gpio chip: %d\n", ret);
return ret;
}
return 0;
}
static void gpmc_gpio_exit(struct gpmc_device *gpmc)
{
gpiochip_remove(&gpmc->gpio_chip);
}
static int gpmc_probe_dt(struct platform_device *pdev)
{
int ret;
@ -2281,7 +2217,69 @@ static int gpmc_probe_dt_children(struct platform_device *pdev)
{
return 0;
}
#endif
#endif /* CONFIG_OF */
static int gpmc_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
{
return 1; /* we're input only */
}
static int gpmc_gpio_direction_input(struct gpio_chip *chip,
unsigned int offset)
{
return 0; /* we're input only */
}
static int gpmc_gpio_direction_output(struct gpio_chip *chip,
unsigned int offset, int value)
{
return -EINVAL; /* we're input only */
}
static void gpmc_gpio_set(struct gpio_chip *chip, unsigned int offset,
int value)
{
}
static int gpmc_gpio_get(struct gpio_chip *chip, unsigned int offset)
{
u32 reg;
offset += 8;
reg = gpmc_read_reg(GPMC_STATUS) & BIT(offset);
return !!reg;
}
static int gpmc_gpio_init(struct gpmc_device *gpmc)
{
int ret;
gpmc->gpio_chip.parent = gpmc->dev;
gpmc->gpio_chip.owner = THIS_MODULE;
gpmc->gpio_chip.label = DEVICE_NAME;
gpmc->gpio_chip.ngpio = gpmc_nr_waitpins;
gpmc->gpio_chip.get_direction = gpmc_gpio_get_direction;
gpmc->gpio_chip.direction_input = gpmc_gpio_direction_input;
gpmc->gpio_chip.direction_output = gpmc_gpio_direction_output;
gpmc->gpio_chip.set = gpmc_gpio_set;
gpmc->gpio_chip.get = gpmc_gpio_get;
gpmc->gpio_chip.base = -1;
ret = gpiochip_add(&gpmc->gpio_chip);
if (ret < 0) {
dev_err(gpmc->dev, "could not register gpio chip: %d\n", ret);
return ret;
}
return 0;
}
static void gpmc_gpio_exit(struct gpmc_device *gpmc)
{
gpiochip_remove(&gpmc->gpio_chip);
}
static int gpmc_probe(struct platform_device *pdev)
{
@ -2437,15 +2435,7 @@ static __init int gpmc_init(void)
{
return platform_driver_register(&gpmc_driver);
}
static __exit void gpmc_exit(void)
{
platform_driver_unregister(&gpmc_driver);
}
postcore_initcall(gpmc_init);
module_exit(gpmc_exit);
static struct omap3_gpmc_regs gpmc_context;