linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haojian Zhuang <haojian.zhuang@gmail.com>
To: linux_newbie good <mylinux.list@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: mylinux.list@gmail.com
Date: Thu, 27 May 2010 13:55:15 +0800	[thread overview]
Message-ID: <AANLkTimuTTH4C-O1CJHLK2XhBHWqx9pZg_aWF0jple0H@mail.gmail.com> (raw)
In-Reply-To: <AANLkTindNIXjAcuGKsg_xBL9jaQ96wxD54xoZe2iPD5v@mail.gmail.com>

On Thu, May 27, 2010 at 1:05 PM, linux_newbie good
<mylinux.list@gmail.com> wrote:
> Hi,
>
> My board has a MIPS based Processor and a micro-controller.  The
> communication between these two interfaces is through an I2C bus. The
> Linux driver for my I2C controller (i mean the one in MIPS processor)
> has support for master transmitter and master receiver whereas I could
> not find support for slave TX and slave RX modes. Do I need to write
> my own functions for slave support? If so, what kind of changes need
> to be done, for slave mode support? Is there any other sample driver
> which can help ?
>
>

Maybe you needn't write a slave I2C driver on MIPS side. It should
based on your system requirement.

I suggest the solution in below may be easier.

++++++++++++++                             ++++++++++++
+ MIPS (Master)  + -----> I2C -----------> + MCU (Slave)  +
+                        +<----GPIO INT <----- +                     +
++++++++++++++                             ++++++++++++

Since MIPS is master, it can read/write data from slave directly.
While MCU want to contact with MIPS, it can trigger INT first. Then
MIPS can query MCU and feed its required.

Perhaps you may not choice this solution. You have to write slave
driver on MIPS side and both master/slave driver on MCU side. You can
refer to $LINUX/drivers/i2c/busses/i2c-pxa.c for reference. i2c-pxa
driver supports both master and slave mode.

Thanks
Haojian

  reply	other threads:[~2010-05-27  5:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27  5:05 mylinux.list@gmail.com linux_newbie good
2010-05-27  5:55 ` Haojian Zhuang [this message]
2010-05-28  5:01   ` mylinux.list@gmail.com Jack

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=AANLkTimuTTH4C-O1CJHLK2XhBHWqx9pZg_aWF0jple0H@mail.gmail.com \
    --to=haojian.zhuang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mylinux.list@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).