[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 02/15] hw/input/lm832x: Define TYPE_LM8323 in public header
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 02/15] hw/input/lm832x: Define TYPE_LM8323 in public header |
Date: |
Wed, 16 Jun 2021 23:42:41 +0200 |
Define TYPE_LM8323 in the public "hw/input/lm832x.h"
header and use it in hw/arm/nseries.c.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/hw/input/lm832x.h | 2 ++
hw/arm/nseries.c | 2 +-
hw/input/lm832x.c | 1 -
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/hw/input/lm832x.h b/include/hw/input/lm832x.h
index f47e579ff90..2a58ccf8916 100644
--- a/include/hw/input/lm832x.h
+++ b/include/hw/input/lm832x.h
@@ -21,6 +21,8 @@
#ifndef HW_INPUT_LM832X
#define HW_INPUT_LM832X
+#define TYPE_LM8323 "lm8323"
+
void lm832x_key_event(DeviceState *dev, int key, int state);
#endif
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index 7b82b8682e8..3a51264e3cf 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -417,7 +417,7 @@ static void n810_kbd_setup(struct n800_s *s)
/* Attach the LM8322 keyboard to the I2C bus,
* should happen in n8x0_i2c_setup and s->kbd be initialised here. */
s->kbd = DEVICE(i2c_slave_create_simple(omap_i2c_bus(s->mpu->i2c[0]),
- "lm8323", N810_LM8323_ADDR));
+ TYPE_LM8323, N810_LM8323_ADDR));
qdev_connect_gpio_out(s->kbd, 0, kbd_irq);
}
diff --git a/hw/input/lm832x.c b/hw/input/lm832x.c
index d2b92b457e3..19a646d9bb4 100644
--- a/hw/input/lm832x.c
+++ b/hw/input/lm832x.c
@@ -28,7 +28,6 @@
#include "ui/console.h"
#include "qom/object.h"
-#define TYPE_LM8323 "lm8323"
OBJECT_DECLARE_SIMPLE_TYPE(LM823KbdState, LM8323)
struct LM823KbdState {
--
2.31.1
- [PATCH v4 00/15] hw/i2c: Remove confusing i2c_send_recv() API, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 01/15] hw/input/lm832x: Move lm832x_key_event() declaration to "lm832x.h", Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 02/15] hw/input/lm832x: Define TYPE_LM8323 in public header,
Philippe Mathieu-Daudé <=
- [PATCH v4 03/15] hw/display/sm501: Simplify sm501_i2c_write() logic, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 04/15] hw/display/sm501: Replace i2c_send_recv() by i2c_recv() & i2c_send(), Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 05/15] hw/i2c/ppc4xx_i2c: Add reference to datasheet, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 06/15] hw/i2c/ppc4xx_i2c: Replace i2c_send_recv() by i2c_recv() & i2c_send(), Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 07/15] hw/misc/auxbus: Fix MOT/classic I2C mode, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 08/15] hw/misc/auxbus: Explode READ_I2C / WRITE_I2C_MOT cases, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 09/15] hw/misc/auxbus: Replace 'is_write' boolean by its value, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 10/15] hw/misc/auxbus: Replace i2c_send_recv() by i2c_recv() & i2c_send(), Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v4 11/15] hw/i2c: Remove confusing i2c_send_recv(), Philippe Mathieu-Daudé, 2021/06/16