68 if ( !
group->regs ) {
113 .
name =
"dwgpio-group",
135 DBGC2 (
dwgpio,
"DWGPIO %s dr %#08x ddr %#08x ctl %#08x\n",
187 unsigned int config ) {
251 if ( parent->
driver != &dwgpio_group_driver ) {
252 DBGC (
dwgpio,
"DWGPIO %s has invalid parent %s\n",
261 DBGC (
dwgpio,
"DWGPIO %s could not get port number: %s\n",
266 DBGC (
dwgpio,
"DWGPIO %s is %s port %d (%d GPIOs)\n",
281 DBGC (
dwgpio,
"DWGPIO %s could not register: %s\n",
323 "snps,dw-apb-gpio-port",
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
uint32_t ctl
Original control register value.
struct dt_driver dwgpio_group_driver __dt_driver
DesignWare GPIO port group devicetree driver.
const char * name
Device name.
void dt_remove_children(struct dt_device *parent)
Remove devicetree children.
uint32_t ddr
Original data direction register value.
static void gpios_put(struct gpios *gpios)
Drop reference to GPIO controller.
#define DWGPIO_EXT_PORT(x)
External port.
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
unsigned int index
Pin index.
unsigned long long uint64_t
struct device * dev
Generic device.
#define DWGPIO_SWPORT_CTL
Control register.
Synopsys DesignWare GPIO driver.
struct device dev
Generic device.
struct gpios * alloc_gpios(unsigned int count, size_t priv_len)
Allocate GPIO controller.
static int dwgpio_config(struct gpios *gpios, struct gpio *gpio, unsigned int config)
Configure GPIO pin.
static void dwgpio_out(struct gpios *gpios, struct gpio *gpio, int active)
Set current GPIO output value.
void * swport
Software port registers.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static int dwgpio_group_probe(struct dt_device *dt, unsigned int offset)
Probe port group.
int(* probe)(struct dt_device *dt, unsigned int offset)
Probe device.
#define ENOMEM
Not enough space.
static struct dt_device * dt_parent(struct dt_device *dt)
Get devicetree parent device.
#define DWGPIO_MAX_COUNT
Maximum number of GPIOs per port.
uint16_t group
Type of event.
#define DWGPIO_SWPORT_DR
Data register.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
int(* in)(struct gpios *gpios, struct gpio *gpio)
Get current GPIO input value.
int fdt_u32(struct fdt *fdt, unsigned int offset, const char *name, uint32_t *value)
Get 32-bit integer property.
static const char * dwgpio_ids[]
DesignWare GPIO port compatible model identifiers.
static const char * dwgpio_group_ids[]
DesignWare GPIO port group compatible model identifiers.
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
struct dt_driver * driver
Driver for this device.
void gpios_unregister(struct gpios *gpios)
Unregister GPIO controller.
#define DWGPIO_SWPORT(x)
Software port.
static unsigned int count
Number of entries.
static int dwgpio_in(struct gpios *gpios, struct gpio *gpio)
Get current GPIO input value.
static void dwgpio_dump(struct dwgpio *dwgpio)
Dump GPIO port status.
A DesignWare GPIO port group.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
static void dt_set_drvdata(struct dt_device *dt, void *priv)
Set devicetree driver-private data.
void * zalloc(size_t size)
Allocate cleared memory.
unsigned int config
Configuration.
uint32_t dr
Original data register value.
#define ENODEV
No such device.
#define GPIO_CFG_OUTPUT
GPIO is an output.
int dt_probe_children(struct dt_device *parent, unsigned int offset)
Probe devicetree children.
static unsigned long dr[NUM_HWBP]
Hardware breakpoint addresses (debug registers 0-3)
static struct xen_remove_from_physmap * remove
int fdt_reg(struct fdt *fdt, unsigned int offset, uint64_t *region)
Get unsized single-entry region address.
uint16_t ext
Extended status.
const char * name
Device name.
int gpios_register(struct gpios *gpios)
Register GPIO controller.
static void gpios_init(struct gpios *gpios, struct gpio_operations *op)
Initialise a GPIO controller.
static void dwgpio_remove(struct dt_device *dt)
Remove port.
const char * name
Driver name.
void * ext
External port register.
static void gpios_nullify(struct gpios *gpios)
Stop using a GPIO controller.
#define DWGPIO_SWPORT_DDR
Data direction register.
void * dt_ioremap(struct dt_device *dt, unsigned int offset, unsigned int index, size_t len)
Map devicetree range.
void iounmap(volatile const void *io_addr)
Unmap I/O address.
static struct gpio_operations dwgpio_operations
GPIO operations.
uint16_t offset
Offset to command line.
static int dwgpio_probe(struct dt_device *dt, unsigned int offset)
Probe port.
unsigned int count
Number of GPIOs.
unsigned int port
Port index.
static void * dt_get_drvdata(struct dt_device *dt)
Get devicetree driver-private data.
void * priv
Driver-private data.
static void dwgpio_group_remove(struct dt_device *dt)
Remove port group.
struct fdt sysfdt
The system flattened device tree (if present)