Skip to content

Commit

Permalink
grlib drivers: name union in platformctl_t
Browse files Browse the repository at this point in the history
JIRA: RTOS-847
  • Loading branch information
lukileczo authored and agkaminski committed Jun 25, 2024
1 parent 21b203d commit b8885c5
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion dma/grdmac2/grdmac2.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ grdma_ctx_t *grdma_init(unsigned int instance)
platformctl_t pctl = {
.action = pctl_get,
.type = pctl_ambapp,
.ambapp = {
.task.ambapp = {
.dev = &dev,
.instance = &instance,
}
Expand Down
6 changes: 3 additions & 3 deletions multi/grlib-multi/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ static int adc_cguInit(int dev)
platformctl_t pctl = {
.action = pctl_set,
.type = pctl_cguctrl,
.cguctrl = {
.state = enable,
.task.cguctrl = {
.v.state = enable,
.cgu = cgu_secondary,
.cgudev = cgudev_gradc0 + dev }
};
Expand Down Expand Up @@ -255,7 +255,7 @@ int adc_init(void)
platformctl_t pctl = {
.action = pctl_get,
.type = pctl_ambapp,
.ambapp = {
.task.ambapp = {
.dev = &dev,
.instance = &instance,
}
Expand Down
2 changes: 1 addition & 1 deletion multi/grlib-multi/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ int gpio_init(void)
platformctl_t pctl = {
.action = pctl_get,
.type = pctl_ambapp,
.ambapp = {
.task.ambapp = {
.dev = &dev,
.instance = &instance,
}
Expand Down
10 changes: 5 additions & 5 deletions multi/grlib-multi/spacewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,8 @@ static int spw_cguInit(int dev)
platformctl_t pctl = {
.action = pctl_set,
.type = pctl_cguctrl,
.cguctrl = {
.state = enable,
.task.cguctrl = {
.v.state = enable,
.cgudev = cgudev_spw0 + dev,
}
};
Expand All @@ -658,8 +658,8 @@ static int spw_cguInit(int dev)
platformctl_t pctl = {
.action = pctl_set,
.type = pctl_cguctrl,
.cguctrl = {
.state = enable,
.task.cguctrl = {
.v.state = enable,
.cgu = cgu_secondary,
.cgudev = cgudev_grspw,
}
Expand Down Expand Up @@ -791,7 +791,7 @@ int spw_init(void)
platformctl_t pctl = {
.action = pctl_get,
.type = pctl_ambapp,
.ambapp = {
.task.ambapp = {
.dev = &dev,
.instance = &instance,
}
Expand Down
18 changes: 9 additions & 9 deletions multi/grlib-multi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,29 +96,29 @@ static int spi_initPins(spi_pins_t *pins)
platformctl_t pctl = {
.action = pctl_set,
.type = pctl_iomux,
.iocfg = {
.task.iocfg = {
.opt = SPI_IOMUX_OPT,
.pulldn = 0,
.pullup = 0,
}
};

pctl.iocfg.pin = pins->sck;
pctl.task.iocfg.pin = pins->sck;
if (platformctl(&pctl) < 0) {
return -1;
}

pctl.iocfg.pin = pins->mosi;
pctl.task.iocfg.pin = pins->mosi;
if (platformctl(&pctl) < 0) {
return -1;
}

pctl.iocfg.pin = pins->miso;
pctl.task.iocfg.pin = pins->miso;
if (platformctl(&pctl) < 0) {
return -1;
}

pctl.iocfg.pin = pins->cs;
pctl.task.iocfg.pin = pins->cs;
if (platformctl(&pctl) < 0) {
return -1;
}
Expand Down Expand Up @@ -280,13 +280,13 @@ static int spi_cguInit(int dev)
platformctl_t pctl = {
.action = pctl_set,
.type = pctl_cguctrl,
.cguctrl = {
.state = enable,
.task.cguctrl = {
.v.state = enable,
.cgu = cgu_primary,
}
};

pctl.cguctrl.cgudev = cgudev_spictrl0 + dev;
pctl.task.cguctrl.cgudev = cgudev_spictrl0 + dev;
return platformctl(&pctl);
#else
return 0;
Expand Down Expand Up @@ -342,7 +342,7 @@ int spi_init(void)
platformctl_t pctl = {
.action = pctl_get,
.type = pctl_ambapp,
.ambapp = {
.task.ambapp = {
.dev = &dev,
.instance = &instance,
}
Expand Down
12 changes: 6 additions & 6 deletions multi/grlib-multi/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ static int uart_cguInit(unsigned int n)
pctl.action = pctl_set;
pctl.type = pctl_cguctrl;

pctl.cguctrl.state = enable;
pctl.cguctrl.cgu = cgu_primary;
pctl.cguctrl.cgudev = cguinfo[n];
pctl.task.cguctrl.v.state = enable;
pctl.task.cguctrl.cgu = cgu_primary;
pctl.task.cguctrl.cgudev = cguinfo[n];

return platformctl(&pctl);
#else
Expand Down Expand Up @@ -446,7 +446,7 @@ static int uart_setup(unsigned int n, speed_t baud, int raw)
platformctl_t pctl = {
.action = pctl_set,
.type = pctl_iomux,
.iocfg = {
.task.iocfg = {
.opt = 0x1,
.pin = info[n].rxPin,
.pullup = 0,
Expand All @@ -458,7 +458,7 @@ static int uart_setup(unsigned int n, speed_t baud, int raw)
return -1;
}

pctl.iocfg.pin = info[n].txPin;
pctl.task.iocfg.pin = info[n].txPin;

if (platformctl(&pctl) < 0) {
return -1;
Expand Down Expand Up @@ -623,7 +623,7 @@ int uart_init(void)
platformctl_t pctl = {
.action = pctl_get,
.type = pctl_ambapp,
.ambapp = {
.task.ambapp = {
.dev = &dev,
.instance = &instance,
}
Expand Down
6 changes: 3 additions & 3 deletions storage/gr716-flash/spimctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int spimctrl_init(spimctrl_t *spimctrl, int instance)
platformctl_t pctl = {

Check warning on line 146 in storage/gr716-flash/spimctrl.c

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon3-gr716-mini)

missing braces around initializer [-Wmissing-braces]

Check warning on line 146 in storage/gr716-flash/spimctrl.c

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon3-gr716-mini)

missing braces around initializer [-Wmissing-braces]
.action = pctl_get,
.type = pctl_cguctrl,
.cguctrl = {
.task.cguctrl = {

Check failure on line 149 in storage/gr716-flash/spimctrl.c

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon3-gr716-mini)

'platformctl_t' {aka 'struct <anonymous>'} has no member named 'task'
.cgu = cgu_primary,

Check failure on line 150 in storage/gr716-flash/spimctrl.c

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon3-gr716-mini)

'union <anonymous>' has no member named 'cgu'
.cgudev = cgudev_spimctrl0 + instance,

Check failure on line 151 in storage/gr716-flash/spimctrl.c

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon3-gr716-mini)

'union <anonymous>' has no member named 'cgudev'

Check warning on line 151 in storage/gr716-flash/spimctrl.c

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon3-gr716-mini)

excess elements in union initializer
}
Expand All @@ -166,9 +166,9 @@ int spimctrl_init(spimctrl_t *spimctrl, int instance)
spimctrl->instance = instance;

/* Enable clock if needed */
if (pctl.cguctrl.stateVal == 0) {
if (pctl.task.cguctrl.v.stateVal == 0) {

Check failure on line 169 in storage/gr716-flash/spimctrl.c

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon3-gr716-mini)

'platformctl_t' {aka 'struct <anonymous>'} has no member named 'task'
pctl.action = pctl_set;
pctl.cguctrl.state = enable;
pctl.task.cguctrl.v.state = enable;

Check failure on line 171 in storage/gr716-flash/spimctrl.c

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon3-gr716-mini)

'platformctl_t' {aka 'struct <anonymous>'} has no member named 'task'
res = platformctl(&pctl);
if (res < 0) {
return res;
Expand Down
14 changes: 7 additions & 7 deletions tty/grlib-uart/grlib-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ static int uart_cguInit(unsigned int n)
ctl.action = pctl_set;
ctl.type = pctl_cguctrl;

ctl.cguctrl.state = enable;
ctl.cguctrl.cgu = cgu_primary;
ctl.cguctrl.cgudev = cguinfo[n];
ctl.task.cguctrl.v.state = enable;
ctl.task.cguctrl.cgu = cgu_primary;
ctl.task.cguctrl.cgudev = cguinfo[n];

return platformctl(&ctl);
#else
Expand All @@ -339,7 +339,7 @@ static int uart_init(unsigned int n, speed_t baud, int raw)
platformctl_t ctl = {
.action = pctl_set,
.type = pctl_iomux,
.iocfg = {
.task.iocfg = {
.opt = 0x1,
.pin = info[n].rxPin,
.pullup = 0,
Expand All @@ -351,7 +351,7 @@ static int uart_init(unsigned int n, speed_t baud, int raw)
return -1;
}

ctl.iocfg.pin = info[n].txPin;
ctl.task.iocfg.pin = info[n].txPin;

if (platformctl(&ctl) < 0) {
return -1;
Expand All @@ -367,8 +367,8 @@ static int uart_init(unsigned int n, speed_t baud, int raw)

ctl.action = pctl_get;
ctl.type = pctl_ambapp;
ctl.ambapp.dev = &dev;
ctl.ambapp.instance = &instance;
ctl.task.ambapp.dev = &dev;
ctl.task.ambapp.instance = &instance;

if (platformctl(&ctl) < 0) {
return -1;
Expand Down

0 comments on commit b8885c5

Please sign in to comment.