From patchwork Fri Mar 15 22:41:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: BALATON Zoltan X-Patchwork-Id: 1057272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=eik.bme.hu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44LgjN0jMKz9s5c for ; Sat, 16 Mar 2019 09:48:39 +1100 (AEDT) Received: from localhost ([127.0.0.1]:33911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4vcz-0001Pd-Up for incoming@patchwork.ozlabs.org; Fri, 15 Mar 2019 18:48:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4vcI-0001Np-Uz for qemu-devel@nongnu.org; Fri, 15 Mar 2019 18:47:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4vbx-0006gx-9n for qemu-devel@nongnu.org; Fri, 15 Mar 2019 18:47:34 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:53545) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h4vbw-0006cD-6x for qemu-devel@nongnu.org; Fri, 15 Mar 2019 18:47:33 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 0282A746600; Fri, 15 Mar 2019 23:47:17 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 6C8787462A9; Fri, 15 Mar 2019 23:47:16 +0100 (CET) Message-Id: In-Reply-To: References: From: BALATON Zoltan Date: Fri, 15 Mar 2019 23:41:30 +0100 MIME-Version: 1.0 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:738:2001:2001::2001 Subject: [Qemu-devel] [PATCH v3 1/2] i2c: Move bitbang_i2c.h to include/hw/i2c/ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The bitbang i2c implementation is also useful for other device models such as DDC in display controllers. Move the header to include/hw/i2c/ to allow it to be used from other device models and adjust users of this include. This also reverts commit 2b4c1125ac which is no longer needed. Signed-off-by: BALATON Zoltan --- hw/i2c/bitbang_i2c.c | 2 +- hw/i2c/ppc4xx_i2c.c | 1 - hw/i2c/versatile_i2c.c | 2 +- {hw => include/hw}/i2c/bitbang_i2c.h | 2 ++ include/hw/i2c/i2c.h | 2 -- include/hw/i2c/ppc4xx_i2c.h | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) rename {hw => include/hw}/i2c/bitbang_i2c.h (80%) diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c index 8be88ee265..b3534a3bd4 100644 --- a/hw/i2c/bitbang_i2c.c +++ b/hw/i2c/bitbang_i2c.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" #include "hw/hw.h" -#include "bitbang_i2c.h" +#include "hw/i2c/bitbang_i2c.h" #include "hw/sysbus.h" //#define DEBUG_BITBANG_I2C diff --git a/hw/i2c/ppc4xx_i2c.c b/hw/i2c/ppc4xx_i2c.c index d6dfafab31..a907d0194e 100644 --- a/hw/i2c/ppc4xx_i2c.c +++ b/hw/i2c/ppc4xx_i2c.c @@ -30,7 +30,6 @@ #include "cpu.h" #include "hw/hw.h" #include "hw/i2c/ppc4xx_i2c.h" -#include "bitbang_i2c.h" #define PPC4xx_I2C_MEM_SIZE 18 diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/versatile_i2c.c index da9f298ee5..39cbcf1948 100644 --- a/hw/i2c/versatile_i2c.c +++ b/hw/i2c/versatile_i2c.c @@ -23,7 +23,7 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" -#include "bitbang_i2c.h" +#include "hw/i2c/bitbang_i2c.h" #include "qemu/log.h" #define TYPE_VERSATILE_I2C "versatile_i2c" diff --git a/hw/i2c/bitbang_i2c.h b/include/hw/i2c/bitbang_i2c.h similarity index 80% rename from hw/i2c/bitbang_i2c.h rename to include/hw/i2c/bitbang_i2c.h index 9443021710..3a7126d5de 100644 --- a/hw/i2c/bitbang_i2c.h +++ b/include/hw/i2c/bitbang_i2c.h @@ -3,6 +3,8 @@ #include "hw/i2c/i2c.h" +typedef struct bitbang_i2c_interface bitbang_i2c_interface; + #define BITBANG_I2C_SDA 0 #define BITBANG_I2C_SCL 1 diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h index 8e236f7bb4..75c5bd638b 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -81,8 +81,6 @@ uint8_t i2c_recv(I2CBus *bus); DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr); -typedef struct bitbang_i2c_interface bitbang_i2c_interface; - /* lm832x.c */ void lm832x_key_event(DeviceState *dev, int key, int state); diff --git a/include/hw/i2c/ppc4xx_i2c.h b/include/hw/i2c/ppc4xx_i2c.h index b3450bacf7..368a5598fe 100644 --- a/include/hw/i2c/ppc4xx_i2c.h +++ b/include/hw/i2c/ppc4xx_i2c.h @@ -29,7 +29,7 @@ #include "qemu-common.h" #include "hw/sysbus.h" -#include "hw/i2c/i2c.h" +#include "hw/i2c/bitbang_i2c.h" #define TYPE_PPC4xx_I2C "ppc4xx-i2c" #define PPC4xx_I2C(obj) OBJECT_CHECK(PPC4xxI2CState, (obj), TYPE_PPC4xx_I2C)