Re: [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h

2018-02-22 Thread Linus Walleij
On Mon, Feb 19, 2018 at 4:20 PM,   wrote:
> From: Corey Minyard 
>
> Some devices need access to it.
>
> Signed-off-by: Corey Minyard 

Reviewed-by: Linus Walleij 

Yours,
Linus Walleij



Re: [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h

2018-02-22 Thread Linus Walleij
On Thu, Feb 22, 2018 at 4:44 PM, Peter Maydell  wrote:
> On 22 February 2018 at 15:39, Linus Walleij  wrote:
>> On Tue, Feb 20, 2018 at 2:06 PM, Corey Minyard  wrote:
>>> Linus, Philippe, do you want me to submit this, or do you want
>>> to take it?  You can pull it from:
>>>
>>> https://github.com/cminyard/qemu.git tags/i2c-bus-move
>>
>> I don't have any commit rights, if you can push this to the
>> QEMU master I will happily rebase my stuff and resubmit :)
>
> I suggest you take Corey's 2 patches, add them to the front
> of your patchset and add your signed-off-by line to them.
> That way you don't have to wait for them to go into git master.

OK no problem!

Yours,
Linus Walleij



Re: [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h

2018-02-22 Thread Peter Maydell
On 22 February 2018 at 15:39, Linus Walleij  wrote:
> On Tue, Feb 20, 2018 at 2:06 PM, Corey Minyard  wrote:
>> Linus, Philippe, do you want me to submit this, or do you want
>> to take it?  You can pull it from:
>>
>> https://github.com/cminyard/qemu.git tags/i2c-bus-move
>
> I don't have any commit rights, if you can push this to the
> QEMU master I will happily rebase my stuff and resubmit :)

I suggest you take Corey's 2 patches, add them to the front
of your patchset and add your signed-off-by line to them.
That way you don't have to wait for them to go into git master.

thanks
-- PMM



Re: [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h

2018-02-22 Thread Linus Walleij
On Tue, Feb 20, 2018 at 2:06 PM, Corey Minyard  wrote:
> On 02/19/2018 09:25 AM, Peter Maydell wrote:
>>
>> On 19 February 2018 at 15:20,   wrote:
>>>
>>> From: Corey Minyard 
>>>
>>> Some devices need access to it.
>>>
>>> Signed-off-by: Corey Minyard 
>>> ---
>>>   hw/i2c/core.c| 17 -
>>>   include/hw/i2c/i2c.h | 17 +
>>>   2 files changed, 17 insertions(+), 17 deletions(-)
>>
>> Reviewed-by: Peter Maydell 
>
>
> Linus, Philippe, do you want me to submit this, or do you want
> to take it?  You can pull it from:
>
> https://github.com/cminyard/qemu.git tags/i2c-bus-move

I don't have any commit rights, if you can push this to the
QEMU master I will happily rebase my stuff and resubmit :)

Yours,
Linus Walleij



Re: [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h

2018-02-20 Thread Corey Minyard

On 02/19/2018 09:25 AM, Peter Maydell wrote:

On 19 February 2018 at 15:20,   wrote:

From: Corey Minyard 

Some devices need access to it.

Signed-off-by: Corey Minyard 
---
  hw/i2c/core.c| 17 -
  include/hw/i2c/i2c.h | 17 +
  2 files changed, 17 insertions(+), 17 deletions(-)

Reviewed-by: Peter Maydell 


Linus, Philippe, do you want me to submit this, or do you want
to take it?  You can pull it from:

https://github.com/cminyard/qemu.git tags/i2c-bus-move

-corey


thanks
-- PMM






Re: [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h

2018-02-19 Thread Peter Maydell
On 19 February 2018 at 15:20,   wrote:
> From: Corey Minyard 
>
> Some devices need access to it.
>
> Signed-off-by: Corey Minyard 
> ---
>  hw/i2c/core.c| 17 -
>  include/hw/i2c/i2c.h | 17 +
>  2 files changed, 17 insertions(+), 17 deletions(-)

Reviewed-by: Peter Maydell 

thanks
-- PMM



[Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h

2018-02-19 Thread minyard
From: Corey Minyard 

Some devices need access to it.

Signed-off-by: Corey Minyard 
---
 hw/i2c/core.c| 17 -
 include/hw/i2c/i2c.h | 17 +
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index 9a54b61..cfccefc 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -10,30 +10,13 @@
 #include "qemu/osdep.h"
 #include "hw/i2c/i2c.h"
 
-typedef struct I2CNode I2CNode;
-
-struct I2CNode {
-I2CSlave *elt;
-QLIST_ENTRY(I2CNode) next;
-};
-
 #define I2C_BROADCAST 0x00
 
-struct I2CBus {
-BusState qbus;
-QLIST_HEAD(, I2CNode) current_devs;
-uint8_t saved_address;
-bool broadcast;
-};
-
 static Property i2c_props[] = {
 DEFINE_PROP_UINT8("address", struct I2CSlave, address, 0),
 DEFINE_PROP_END_OF_LIST(),
 };
 
-#define TYPE_I2C_BUS "i2c-bus"
-#define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS)
-
 static const TypeInfo i2c_bus_info = {
 .name = TYPE_I2C_BUS,
 .parent = TYPE_BUS,
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index 8fd449f..d727379 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -56,6 +56,23 @@ struct I2CSlave {
 uint8_t address;
 };
 
+#define TYPE_I2C_BUS "i2c-bus"
+#define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS)
+
+typedef struct I2CNode I2CNode;
+
+struct I2CNode {
+I2CSlave *elt;
+QLIST_ENTRY(I2CNode) next;
+};
+
+struct I2CBus {
+BusState qbus;
+QLIST_HEAD(, I2CNode) current_devs;
+uint8_t saved_address;
+bool broadcast;
+};
+
 I2CBus *i2c_init_bus(DeviceState *parent, const char *name);
 void i2c_set_slave_address(I2CSlave *dev, uint8_t address);
 int i2c_bus_busy(I2CBus *bus);
-- 
2.7.4