From: Daniel Glöckner on
On 07/21/2010 07:52 PM, Kenneth Heitke wrote:
> Unlike I2C, SSBI is a point-to-point connection, and therefore there is no
> need to specify a slave device address. The SSBI implementation
> overrides the slave device address to be a device register address
> instead. This restricts the client drivers from using the SMBus
> communication APIs unless they update the address field (addr) of the
> i2c_client structure prior to every SMBus function call.

Is it just me who is uncomfortable with this?

If I am not mistaken, you still have to update the i2c_client structure
when using the SMBus API.

And how do you intend to bind a driver to an SSBI device if there is not a
single address to bind to?

The Qualcomm SSBI patent mentiones the possibility of adding logic to chips
to be accessible over both SSBI and the three wire SBI interface. The SBI
interface on the other hand is even closer to I2C and requires the use of
a slave ID byte. If you didn't abuse the address field, you could write
drivers that work on both interfaces.

Why not use one of the special addresses mentioned in the I2C specification
for SSBI? 0x02 might be appropriate.

> +static int
> +i2c_ssbi_write_bytes(struct i2c_ssbi_dev *ssbi, struct i2c_msg *msg)
> +{
> + int ret = 0;
> + u8 *buf = msg->buf;
> + u16 len = msg->len;
> + u16 addr = msg->addr;
> +
> + if (ssbi->controller_type == MSM_SBI_CTRL_SSBI2) {
> + u32 mode2 = readl(ssbi->base + SSBI2_MODE2);
> + writel(SSBI_MODE2_REG_ADDR_15_8(mode2, addr),
> + ssbi->base + SSBI2_MODE2);
> + }
> +
> + while (len) {

Where do you set the address if controller_type == MSM_SBI_CTRL_SSBI?

Daniel


--
Dipl.-Math. Daniel Gl�ckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 G�ttingen, Germany
Sitz der Gesellschaft: G�ttingen, Amtsgericht G�ttingen HR B 3160
Gesch�ftsf�hrer: Dr. Uwe Kracke, Ust-IdNr.: DE 205 198 055

emlix - your embedded linux partner
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Kenneth Heitke on
Daniel Gl�ckner wrote:
> On 07/21/2010 07:52 PM, Kenneth Heitke wrote:
>> Unlike I2C, SSBI is a point-to-point connection, and therefore there is no
>> need to specify a slave device address. The SSBI implementation
>> overrides the slave device address to be a device register address
>> instead. This restricts the client drivers from using the SMBus
>> communication APIs unless they update the address field (addr) of the
>> i2c_client structure prior to every SMBus function call.
>
>
>> +static int
>> +i2c_ssbi_write_bytes(struct i2c_ssbi_dev *ssbi, struct i2c_msg *msg)
>> +{
>> + int ret = 0;
>> + u8 *buf = msg->buf;
>> + u16 len = msg->len;
>> + u16 addr = msg->addr;
>> +
>> + if (ssbi->controller_type == MSM_SBI_CTRL_SSBI2) {
>> + u32 mode2 = readl(ssbi->base + SSBI2_MODE2);
>> + writel(SSBI_MODE2_REG_ADDR_15_8(mode2, addr),
>> + ssbi->base + SSBI2_MODE2);
>> + }
>> +
>> + while (len) {
>
> Where do you set the address if controller_type == MSM_SBI_CTRL_SSBI?
>
> Daniel
>
>

The SSBI_MODE2_REG_ADDR register contains the upper 8-bits of the
address which is only supported by SSBI 2.0. The lower 8 address bits
are written as part of the SSBI_CMD_WRITE macro which is common for both
of the controller types.

--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Kenneth Heitke on
Daniel Gl�ckner wrote:
> On 07/21/2010 07:52 PM, Kenneth Heitke wrote:
>> Unlike I2C, SSBI is a point-to-point connection, and therefore there is no
>> need to specify a slave device address. The SSBI implementation
>> overrides the slave device address to be a device register address
>> instead. This restricts the client drivers from using the SMBus
>> communication APIs unless they update the address field (addr) of the
>> i2c_client structure prior to every SMBus function call.
>
> Is it just me who is uncomfortable with this?
>
> If I am not mistaken, you still have to update the i2c_client structure
> when using the SMBus API.

Yes, you are correct if the SMBus API is being used.

Each SSBI transaction consists of an address and a data word. I need to
get the address information somehow and I didn't want to have to fetch
this information from the data buffer passed in for the clients.

>
> And how do you intend to bind a driver to an SSBI device if there is not a
> single address to bind to?

There is only one device per controller therefore the binding is done
using the bus number. If I have 3 devices, then I have 3 independent buses.

>
> The Qualcomm SSBI patent mentiones the possibility of adding logic to chips
> to be accessible over both SSBI and the three wire SBI interface. The SBI
> interface on the other hand is even closer to I2C and requires the use of
> a slave ID byte. If you didn't abuse the address field, you could write
> drivers that work on both interfaces.

The driver doesn't support the three wire SBI interface. That interface
has been replaced with the single wire interface and won't be support
under Linux.

>
> Why not use one of the special addresses mentioned in the I2C specification
> for SSBI? 0x02 might be appropriate.
>

--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Kenneth Heitke on
Daniel Gl�ckner wrote:
> On 07/21/2010 07:52 PM, Kenneth Heitke wrote:
>> Unlike I2C, SSBI is a point-to-point connection, and therefore there is no
>> need to specify a slave device address. The SSBI implementation
>> overrides the slave device address to be a device register address
>> instead. This restricts the client drivers from using the SMBus
>> communication APIs unless they update the address field (addr) of the
>> i2c_client structure prior to every SMBus function call.
>
> Is it just me who is uncomfortable with this?
>
> If I am not mistaken, you still have to update the i2c_client structure
> when using the SMBus API.

Yes, you are correct if the SMBus API is being used.

Each SSBI transaction consists of an address and a data word. I need to
get the address information somehow and I didn't want to have to fetch
this information from the data buffer passed in for the clients.

>
> And how do you intend to bind a driver to an SSBI device if there is not a
> single address to bind to?

There is only one device per controller therefore the binding is done
using the bus number. If I have 3 devices, then I have 3 independent buses.

>
> The Qualcomm SSBI patent mentiones the possibility of adding logic to chips
> to be accessible over both SSBI and the three wire SBI interface. The SBI
> interface on the other hand is even closer to I2C and requires the use of
> a slave ID byte. If you didn't abuse the address field, you could write
> drivers that work on both interfaces.

The driver doesn't support the three wire SBI interface. That interface
has been replaced with the single wire interface and won't be support
under Linux.

>
> Why not use one of the special addresses mentioned in the I2C specification
> for SSBI? 0x02 might be appropriate.
>

--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Pavel Machek on
Hi!

> This bus driver supports the Single-wire Serial Bus Interface (SSBI)
> controller in the Qualcomm MSM SOCs. SSBI is not an I2C but is
> functionally related enough such that it is able to leaverage the I2C
> framework.
>
> Unlike I2C, SSBI is a point-to-point connection, and therefore there is no
> need to specify a slave device address. The SSBI implementation
> overrides the slave device address to be a device register address

Then perhaps it should not go to drivers/i2c?

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/