Skip to content

Commit

Permalink
pinctrl: zhaoxin: fix issues when builting into module
Browse files Browse the repository at this point in the history
Add missing header file declarations due to changes in code version. And
fix other issues that are causing built errors.

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
  • Loading branch information
leoliu-oc authored and opsiff committed Jul 23, 2024
1 parent 6290ed1 commit 9006b92
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions drivers/pinctrl/zhaoxin/pinctrl-zhaoxin.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,11 @@
#include <linux/pinctrl/pinmux.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/consumer.h>

#include "../core.h"
#include "pinctrl-zhaoxin.h"

static int pin_to_hwgpio(struct pinctrl_gpio_range *range, unsigned int pin)
{
int offset = 0;

if (range->pins) {
for (offset = 0; offset < range->npins; offset++)
if (pin == range->pins[offset])
break;
return range->base+offset-range->gc->base;
} else
return pin-range->pin_base+range->base-range->gc->base;
}

static u16 zx_pad_read16(struct zhaoxin_pinctrl *pctrl, u8 index)
{
outb(index, pctrl->pmio_rx90+pctrl->pmio_base);
Expand Down Expand Up @@ -498,7 +486,7 @@ static int zhaoxin_gpio_irq_type(struct irq_data *d, unsigned int type)
else if (type & IRQ_TYPE_LEVEL_HIGH)
value |= TRIGGER_HIGH_LEVEL << (point*4);
else
pr_debug(pctrl, "%s wrang type\n", __func__);
pr_debug("%s wrong type\n", __func__);

zx_pad_write16(pctrl, index, value);

Expand Down

0 comments on commit 9006b92

Please sign in to comment.