Skip to contentSkip to conversation

hw/misc: small fixes for i2c-echo

PATCH Superseded Klaus Jensen 3 participants 6 messages Aug 23, 2023 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover hw/misc: small fixes for i2c-echo

Add missing copyright/license note and add a Kconfig entry.

---
Klaus Jensen (2):
hw/misc/i2c-echo: add copyright/license note hw/misc/Kconfig: add switch for i2c-echo

 hw/misc/Kconfig     |  5 +++++
 hw/misc/i2c-echo.c  | 10 ++++++++++
 hw/misc/meson.build |  2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)

---
base-commit: b0dd9a7d6dd15a6898e9c585b521e6bec79b25aa
change-id: 20230823-i2c-echo-fixes-945c0bf059b5

Best regards,

Signature · 1 line
Klaus Jensen <[email protected]>
#1 lore raw

PATCH 1/2 hw/misc/i2c-echo: add copyright/license note

From: Klaus Jensen <[email protected]>

Add missing copyright and license notice. Also add a short description of the device.

---
 hw/misc/i2c-echo.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
hw/misc/i2c-echo.c +10 -0
index 5705ab5d7349..5ae3d0817ead 100644
@@ -1,3 +1,13 @@
+/*
+ * Example I2C device using asynchronous I2C send.
+ *
+ * Copyright (C) 2023 Samsung Electronics Co., Ltd. All Rights Reserved.
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ */
+
 #include "qemu/osdep.h"
 #include "qemu/timer.h"
 #include "qemu/main-loop.h"
Signature · 1 line
2.42.0
#2 lore raw

Re: [PATCH 1/2] hw/misc/i2c-echo: add copyright/license note

Quoted 15 lines · Klaus Jensen

From: Klaus Jensen <[email protected]>

Add missing copyright and license notice. Also add a short description of the device.

---
  hw/misc/i2c-echo.c | 10 ++++++++++
  1 file changed, 10 insertions(+)
hw/misc/i2c-echo.c +0 -0
index 5705ab5d7349..5ae3d0817ead 100644

hw/misc/i2c-echo.c line 7

Quoted 7 lines
hw/misc/i2c-echo.c +7 -0
@@ -1,3 +1,13 @@
+/*
+ * Example I2C device using asynchronous I2C send.
+ *
+ * Copyright (C) 2023 Samsung Electronics Co., Ltd. All Rights Reserved.
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.

That means GPL-2.0-only ? Please change this into GPL-2.0-or-later instead if possible, since according our main "LICENSE" file:

"As of July 2013, contributions under version 2 of the GNU General Public License (and no later version) are only accepted for the following files or directories: bsd-user/, linux-user/, hw/vfio/, hw/xen/xen_pt*"

While you're at it, I'd also appreciate a SPDX-License-Identifier line here.

Thanks,
Thomas

#3 lore raw

PATCH 2/2 hw/misc/Kconfig: add switch for i2c-echo

In reply to Klaus Jensen

From: Klaus Jensen <[email protected]>

Associate i2c-echo with TEST_DEVICES and add a dependency on I2C.

---
 hw/misc/Kconfig     | 5 +++++
 hw/misc/meson.build | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
hw/misc/Kconfig +5 -0
index 6996d265e4c5..9ec7a40f973a 100644
@@ -34,6 +34,11 @@ config PCA9552
     bool
     depends on I2C
 
+config I2C_ECHO
+    bool
+    default y if TEST_DEVICES
+    depends on I2C
+
 config PL310
     bool
 
hw/misc/meson.build +1 -1
index 892f8b91c572..fbea23f8b27f 100644
@@ -132,7 +132,7 @@ system_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_rng.c'))
 
 system_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_ahb_apb_pnp.c'))
 
-system_ss.add(when: 'CONFIG_I2C', if_true: files('i2c-echo.c'))
+system_ss.add(when: 'CONFIG_I2C_ECHO', if_true: files('i2c-echo.c'))
 
 specific_ss.add(when: 'CONFIG_AVR_POWER', if_true: files('avr_power.c'))
 
Signature · 1 line
2.42.0
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] hw/misc/Kconfig: add switch for i2c-echo

Quoted 31 lines · Klaus Jensen

From: Klaus Jensen <[email protected]>

Associate i2c-echo with TEST_DEVICES and add a dependency on I2C.

---
  hw/misc/Kconfig     | 5 +++++
  hw/misc/meson.build | 2 +-
  2 files changed, 6 insertions(+), 1 deletion(-)
hw/misc/Kconfig +5 -0
index 6996d265e4c5..9ec7a40f973a 100644
@@ -34,6 +34,11 @@ config PCA9552
      bool
      depends on I2C
 
+config I2C_ECHO
+    bool
+    default y if TEST_DEVICES
+    depends on I2C
+
  config PL310
      bool
 
hw/misc/meson.build +0 -0
index 892f8b91c572..fbea23f8b27f 100644

hw/misc/meson.build system_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_rng.c')) · line 137

Quoted 7 lines
hw/misc/meson.build +1 -1
@@ -132,7 +132,7 @@ system_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_rng.c'))
 
  system_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_ahb_apb_pnp.c'))
 
-system_ss.add(when: 'CONFIG_I2C', if_true: files('i2c-echo.c'))
+system_ss.add(when: 'CONFIG_I2C_ECHO', if_true: files('i2c-echo.c'))
 
  specific_ss.add(when: 'CONFIG_AVR_POWER', if_true: files('avr_power.c'))

Thanks, very appreciated!

Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH 2/2] hw/misc/Kconfig: add switch for i2c-echo

In reply to Klaus Jensen
Quoted 9 lines · Klaus Jensen

From: Klaus Jensen <[email protected]>

Associate i2c-echo with TEST_DEVICES and add a dependency on I2C.

---
  hw/misc/Kconfig     | 5 +++++
  hw/misc/meson.build | 2 +-
  2 files changed, 6 insertions(+), 1 deletion(-)