From: "Mark A. Greer" <mgreer@mvista•com>
To: Kumar Gala <kumar.gala@freescale•com>
Cc: Scott Hall <shall@mvista•com>,
Embedded PPC Linux list <linuxppc-embedded@ozlabs•org>
Subject: Re: mpc-i2c.c in 2.6
Date: Thu, 13 Jan 2005 14:33:10 -0700 [thread overview]
Message-ID: <41E6E916.6040408@mvista.com> (raw)
In-Reply-To: <8A6296CC-65A9-11D9-B612-000393DBC2E8@freescale.com>
Kumar Gala wrote:
> Adrian,
>
> I was wondering if you had any opinions on the timeout between
> transactions in drivers/i2c/busses/mpc-i2c. Looking at it, we
> currently set the timeout between transactions to 1 second (HZ). Any
> reason its this high?
>
> on 85xx, I'm able to set it to HZ/100 w/o any really issue.
This is just an FYI since I've been in this code recently. You can
change the timeout from userspace with an ioctl. Something like this
should do it:
static char *usage_msg = "Usage: set_timeout <timeout value>\n";
int main(int argc, char **argv)
{
uint timeout;
int file;
if (argc != 2) {
fprintf(stderr, usage_msg);
return 1;
}
timeout = strtoul(argv[1], NULL, 0);
if ((file = open("/dev/i2c/0", O_RDWR)) < 0) {
printf("Can't open device, errno: %d (%s)\n",
errno, strerror(errno));
return 1;
}
if (ioctl(file, I2C_TIMEOUT, &timeout) < 0) {
printf("Can't do TIMEOUT: %s\n", strerror(errno));
return 1;
}
return 0;
}
next prev parent reply other threads:[~2005-01-13 21:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-13 21:24 mpc-i2c.c in 2.6 Kumar Gala
2005-01-13 21:33 ` Mark A. Greer [this message]
2005-01-14 18:06 ` Adrian Cox
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=41E6E916.6040408@mvista.com \
--to=mgreer@mvista$(echo .)com \
--cc=kumar.gala@freescale$(echo .)com \
--cc=linuxppc-embedded@ozlabs$(echo .)org \
--cc=shall@mvista$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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