Skip to content

Commit d5d6978

Browse files
author
Tavish Naruka
committed
fixup gpio
1 parent cc4599b commit d5d6978

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/gpio/gpio_tms570.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,22 @@ struct gpio_tms570_data {
4848
struct gpio_driver_data common;
4949
};
5050

51-
static int gpio_tms570_set_bits(const struct device *dev, gpio_port_pins_t pin)
51+
static int gpio_tms570_set_bits(const struct device *dev, gpio_port_pins_t pins)
5252
{
5353
const struct gpio_tms570_config *config = dev->config;
5454

55-
sys_write32(pin, config->reg_port + REG_DOUT);
55+
sys_write32(pins, config->reg_port + REG_DSET);
5656

5757
return 0;
5858
}
5959

60-
static int gpio_tms570_clear_bits(const struct device *dev, gpio_port_pins_t pin)
60+
static int gpio_tms570_clear_bits(const struct device *dev, gpio_port_pins_t pins)
6161
{
6262
const struct gpio_tms570_config *config = dev->config;
6363
uint32_t val;
6464

6565
val = sys_read32(config->reg_port + REG_DIN);
66-
sys_write32(val & (uint32_t)~pin, config->reg_port + REG_DOUT);
66+
sys_write32(val & pins, config->reg_port + REG_DCLR);
6767

6868
return 0;
6969
}
@@ -83,8 +83,8 @@ static int gpio_tms570_port_set_masked_raw(const struct device *dev,
8383
val_clr = cur_dir & cur_out & ~value & mask;
8484
val_set = cur_dir & ~cur_out & value & mask;
8585

86-
sys_write32(cur_out & (uint32_t)~val_clr, config->reg_port + REG_DOUT);
87-
sys_write32(val_set, config->reg_port + REG_DOUT);
86+
sys_write32(val_clr, config->reg_port + REG_DCLR);
87+
sys_write32(val_set, config->reg_port + REG_DSET);
8888

8989
return 0;
9090
}
@@ -102,8 +102,8 @@ static int gpio_tms570_port_toggle_bits(const struct device *dev,
102102
cur_dir = sys_read32(config->reg_port + REG_DIR);
103103
val_clr = cur_dir & cur_out & pins;
104104
val_set = cur_dir & ~cur_out & pins;
105-
sys_write32(cur_out & (uint32_t)~val_clr, config->reg_port + REG_DOUT);
106-
sys_write32(val_set, config->reg_port + REG_DOUT);
105+
sys_write32(val_clr, config->reg_port + REG_DCLR);
106+
sys_write32(val_set, config->reg_port + REG_DSET);
107107

108108
return 0;
109109
}

0 commit comments

Comments
 (0)