pl050: checkpatch fixes
This patch also includes a couple of minor spacing updates. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-15-mark.cave-ayland@ilande.co.uk>
This commit is contained in:
parent
97259e70cb
commit
600f71109d
@ -53,8 +53,9 @@ static const VMStateDescription vmstate_pl050 = {
|
|||||||
#define PL050_KMIC (1 << 1)
|
#define PL050_KMIC (1 << 1)
|
||||||
#define PL050_KMID (1 << 0)
|
#define PL050_KMID (1 << 0)
|
||||||
|
|
||||||
static const unsigned char pl050_id[] =
|
static const unsigned char pl050_id[] = {
|
||||||
{ 0x50, 0x10, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1 };
|
0x50, 0x10, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1
|
||||||
|
};
|
||||||
|
|
||||||
static void pl050_update(void *opaque, int level)
|
static void pl050_update(void *opaque, int level)
|
||||||
{
|
{
|
||||||
@ -71,8 +72,10 @@ static uint64_t pl050_read(void *opaque, hwaddr offset,
|
|||||||
unsigned size)
|
unsigned size)
|
||||||
{
|
{
|
||||||
PL050State *s = (PL050State *)opaque;
|
PL050State *s = (PL050State *)opaque;
|
||||||
if (offset >= 0xfe0 && offset < 0x1000)
|
|
||||||
|
if (offset >= 0xfe0 && offset < 0x1000) {
|
||||||
return pl050_id[(offset - 0xfe0) >> 2];
|
return pl050_id[(offset - 0xfe0) >> 2];
|
||||||
|
}
|
||||||
|
|
||||||
switch (offset >> 2) {
|
switch (offset >> 2) {
|
||||||
case 0: /* KMICR */
|
case 0: /* KMICR */
|
||||||
@ -88,16 +91,19 @@ static uint64_t pl050_read(void *opaque, hwaddr offset,
|
|||||||
val = (val ^ (val >> 1)) & 1;
|
val = (val ^ (val >> 1)) & 1;
|
||||||
|
|
||||||
stat = PL050_TXEMPTY;
|
stat = PL050_TXEMPTY;
|
||||||
if (val)
|
if (val) {
|
||||||
stat |= PL050_RXPARITY;
|
stat |= PL050_RXPARITY;
|
||||||
if (s->pending)
|
}
|
||||||
|
if (s->pending) {
|
||||||
stat |= PL050_RXFULL;
|
stat |= PL050_RXFULL;
|
||||||
|
}
|
||||||
|
|
||||||
return stat;
|
return stat;
|
||||||
}
|
}
|
||||||
case 2: /* KMIDATA */
|
case 2: /* KMIDATA */
|
||||||
if (s->pending)
|
if (s->pending) {
|
||||||
s->last = ps2_read_data(s->dev);
|
s->last = ps2_read_data(s->dev);
|
||||||
|
}
|
||||||
return s->last;
|
return s->last;
|
||||||
case 3: /* KMICLKDIV */
|
case 3: /* KMICLKDIV */
|
||||||
return s->clk;
|
return s->clk;
|
||||||
@ -114,6 +120,7 @@ static void pl050_write(void *opaque, hwaddr offset,
|
|||||||
uint64_t value, unsigned size)
|
uint64_t value, unsigned size)
|
||||||
{
|
{
|
||||||
PL050State *s = (PL050State *)opaque;
|
PL050State *s = (PL050State *)opaque;
|
||||||
|
|
||||||
switch (offset >> 2) {
|
switch (offset >> 2) {
|
||||||
case 0: /* KMICR */
|
case 0: /* KMICR */
|
||||||
s->cr = value;
|
s->cr = value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user