linux/drivers/pinctrl/vt8500/pinctrl-wmt.h
Paul Gortmaker 23d511f6fe pinctrl: vt8500: make bool drivers explicitly non-modular
None of the Kconfigs for any of these drivers are tristate, meaning
that they currently are not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the drivers there is no doubt they are builtin-only.  All
drivers get the exact same change, so they are handled in batch.

Changes are (1) use builtin_platform_driver, (2) use init.h header
(3) delete module_exit related code, (4) delete MODULE_DEVICE_TABLE,
(5) delete MODULE_LICENCE/MODULE_AUTHOR and associated tags and (6)
drop ".remove" code and prevent sysfs unbind attempts to call ".remove".

Once this is done, the shared remove function in wmt.[ch] is no longer
used and hence it is removed as well.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE etc. tags since all that information
is already contained at the top of each file in the comments.

Cc: Tony Prisk <linux@prisktech.co.nz>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-11-15 10:04:20 +01:00

79 lines
1.9 KiB
C

/*
* Pinctrl driver for the Wondermedia SoC's
*
* Copyright (c) 2013 Tony Prisk <linux@prisktech.co.nz>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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 <linux/gpio.h>
/* VT8500 has no enable register in the extgpio bank. */
#define NO_REG 0xFFFF
#define WMT_PINCTRL_BANK(__en, __dir, __dout, __din, __pen, __pcfg) \
{ \
.reg_en = __en, \
.reg_dir = __dir, \
.reg_data_out = __dout, \
.reg_data_in = __din, \
.reg_pull_en = __pen, \
.reg_pull_cfg = __pcfg, \
}
/* Encode/decode the bank/bit pairs into a pin value */
#define WMT_PIN(__bank, __offset) ((__bank << 5) | __offset)
#define WMT_BANK_FROM_PIN(__pin) (__pin >> 5)
#define WMT_BIT_FROM_PIN(__pin) (__pin & 0x1f)
#define WMT_GROUP(__name, __data) \
{ \
.name = __name, \
.pins = __data, \
.npins = ARRAY_SIZE(__data), \
}
struct wmt_pinctrl_bank_registers {
u32 reg_en;
u32 reg_dir;
u32 reg_data_out;
u32 reg_data_in;
u32 reg_pull_en;
u32 reg_pull_cfg;
};
struct wmt_pinctrl_group {
const char *name;
const unsigned int *pins;
const unsigned npins;
};
struct wmt_pinctrl_data {
struct device *dev;
struct pinctrl_dev *pctl_dev;
/* must be initialized before calling wmt_pinctrl_probe */
void __iomem *base;
const struct wmt_pinctrl_bank_registers *banks;
const struct pinctrl_pin_desc *pins;
const char * const *groups;
u32 nbanks;
u32 npins;
u32 ngroups;
struct gpio_chip gpio_chip;
struct pinctrl_gpio_range gpio_range;
};
int wmt_pinctrl_probe(struct platform_device *pdev,
struct wmt_pinctrl_data *data);