From: Kenneth Heitke <kheitke@codeaurora.org>
To: "Daniel Glöckner" <dg@emlix.com>
Cc: khali@linux-fr.org, ben-linux@fluff.org,
linux-arm-msm@vger.kernel.org, sdharia@codeaurora.org,
Crane Cai <crane.cai@amd.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Linus Walleij <linus.walleij@stericsson.com>,
Ralf Baechle <ralf@linux-mips.org>,
srinidhi kasagar <srinidhi.kasagar@stericsson.com>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: Single-wire Serial Bus Interface for Qualcomm MSM chipsets
Date: Fri, 23 Jul 2010 12:32:33 -0600 [thread overview]
Message-ID: <4C49E041.8070009@codeaurora.org> (raw)
In-Reply-To: <4C496C58.1080806@emlix.com>
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.
WARNING: multiple messages have this Message-ID (diff)
From: Kenneth Heitke <kheitke-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: "Daniel Glöckner" <dg-QdrG9jWwCLEAvxtiuMwx3w@public.gmane.org>
Cc: khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org,
ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
sdharia-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
Crane Cai <crane.cai-5C7GfCeVMHo@public.gmane.org>,
Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Linus Walleij
<linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>,
Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>,
srinidhi kasagar
<srinidhi.kasagar-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] i2c: Single-wire Serial Bus Interface for Qualcomm MSM chipsets
Date: Fri, 23 Jul 2010 12:32:33 -0600 [thread overview]
Message-ID: <4C49E041.8070009@codeaurora.org> (raw)
In-Reply-To: <4C496C58.1080806-QdrG9jWwCLEAvxtiuMwx3w@public.gmane.org>
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.
next prev parent reply other threads:[~2010-07-23 18:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-21 17:52 [PATCH] i2c: Single-wire Serial Bus Interface for Qualcomm MSM chipsets Kenneth Heitke
2010-07-21 17:52 ` Kenneth Heitke
2010-07-23 10:18 ` Daniel Glöckner
2010-07-23 18:32 ` Kenneth Heitke [this message]
2010-07-23 18:32 ` Kenneth Heitke
2010-07-23 20:48 ` Kenneth Heitke
2010-07-23 20:48 ` Kenneth Heitke
2010-07-23 20:50 ` Kenneth Heitke
2010-07-28 13:26 ` Pavel Machek
2010-07-28 13:26 ` Pavel Machek
2010-08-10 2:26 ` Kenneth Heitke
2010-08-10 2:26 ` Kenneth Heitke
2010-08-10 21:41 ` Pavel Machek
2010-08-10 21:41 ` Pavel Machek
2010-09-24 22:48 ` Kenneth Heitke
2010-09-24 22:48 ` Kenneth Heitke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C49E041.8070009@codeaurora.org \
--to=kheitke@codeaurora.org \
--cc=ben-linux@fluff.org \
--cc=crane.cai@amd.com \
--cc=dg@emlix.com \
--cc=khali@linux-fr.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=sameo@linux.intel.com \
--cc=sdharia@codeaurora.org \
--cc=srinidhi.kasagar@stericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.