CINXE.COM
LKML: "Randy.Dunlap": Re: [PATCH] kernel 2.6.11.6 - I2C adaptor for ColdFire 5282 CPU
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>LKML: "Randy.Dunlap": Re: [PATCH] kernel 2.6.11.6 - I2C adaptor for ColdFire 5282 CPU</title><link href="/css/message.css" rel="stylesheet" type="text/css" /><link href="/css/wrap.css" rel="alternate stylesheet" type="text/css" title="wrap" /><link href="/css/nowrap.css" rel="stylesheet" type="text/css" title="nowrap" /><link href="/favicon.ico" rel="shortcut icon" /><script src="/js/simple-calendar.js" type="text/javascript"></script><script src="/js/styleswitcher.js" type="text/javascript"></script><link rel="alternate" type="application/rss+xml" title="lkml.org : last 100 messages" href="/rss.php" /><link rel="alternate" type="application/rss+xml" title="lkml.org : last messages by "Randy.Dunlap"" href="/groupie.php?aid=1262" /><!--Matomo--><script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setDoNotTrack", true]); _paq.push(["disableCookies"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//m.lkml.org/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script><!--End Matomo Code--></head><body onload="es.jasper.simpleCalendar.init();" itemscope="itemscope" itemtype="http://schema.org/BlogPosting"><table border="0" cellpadding="0" cellspacing="0"><tr><td width="180" align="center"><a href="/"><img style="border:0;width:135px;height:32px" src="/images/toprowlk.gif" alt="lkml.org" /></a></td><td width="32">聽</td><td class="nb"><div><a class="nb" href="/lkml"> [lkml]</a> 聽 <a class="nb" href="/lkml/2005"> [2005]</a> 聽 <a class="nb" href="/lkml/2005/4"> [Apr]</a> 聽 <a class="nb" href="/lkml/2005/4/5"> [5]</a> 聽 <a class="nb" href="/lkml/last100"> [last100]</a> 聽 <a href="/rss.php"><img src="/images/rss-or.gif" border="0" alt="RSS Feed" /></a></div><div>Views: <a href="#" class="nowrap" onclick="setActiveStyleSheet('wrap');return false;">[wrap]</a><a href="#" class="wrap" onclick="setActiveStyleSheet('nowrap');return false;">[no wrap]</a> 聽 <a class="nb" href="/lkml/mheaders/2005/4/5/408" onclick="this.href='/lkml/headers'+'/2005/4/5/408';">[headers]</a>聽 <a href="/lkml/bounce/2005/4/5/408">[forward]</a>聽 </div></td><td width="32">聽</td></tr><tr><td valign="top"><div class="es-jasper-simpleCalendar" baseurl="/lkml/"></div><div class="threadlist">Messages in this thread</div><ul class="threadlist"><li class="root"><a href="/lkml/2005/4/5/400">First message in thread</a></li><li><a href="/lkml/2005/4/5/401">Andrew Morton</a><ul><li><a href="/lkml/2005/4/5/402">"Derek Cheung"</a><ul><li class="origin"><a href="/lkml/2005/4/7/256">"Randy.Dunlap"</a><ul><li><a href="/lkml/2005/4/7/256">Matt Mackall</a><ul><li><a href="/lkml/2005/4/7/257">"Randy.Dunlap"</a></li></ul></li></ul></li><li><a href="/lkml/2005/4/5/413">"Randy.Dunlap"</a><ul><li><a href="/lkml/2005/4/6/111">Greg KH</a></li><li><a href="/lkml/2005/4/10/73">"Derek Cheung"</a><ul><li><a href="/lkml/2005/4/10/185">Andrew Morton</a></li><li><a href="/lkml/2005/4/10/217">"Randy.Dunlap"</a></li><li><a href="/lkml/2005/4/11/218">Greg KH</a></li></ul></li></ul></li></ul></li></ul></li></ul></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerl.gif" width="32" height="32" alt="/" /></td><td class="c" rowspan="2" valign="top" style="padding-top: 1em"><table><tr><td><table><tr><td class="lp">Date</td><td class="rp" itemprop="datePublished">Tue, 05 Apr 2005 20:10:27 -0700</td></tr><tr><td class="lp">From</td><td class="rp" itemprop="author">"Randy.Dunlap" <></td></tr><tr><td class="lp">Subject</td><td class="rp" itemprop="name">Re: [PATCH] kernel 2.6.11.6 - I2C adaptor for ColdFire 5282 CPU</td></tr></table></td><td></td></tr></table><pre itemprop="articleBody">Derek Cheung wrote:<br />> <br />>> Below please find the patch file I "diff" against Linux 2.6.11.6. It<br />>> contains the I2C adaptor for ColdFire 5282 CPU. Since most ColdFire<br />> <br />> CPU<br />> <br />>> shares the same I2C register set, the code can be easily adopted for<br />>> other ColdFire CPUs for I2C operations.<br />>><br />>> I have tested the code on a ColdFire 5282Lite CPU board<br />>> (<a href="http://www.axman.com/Pages/cml-5282LITE.html">http://www.axman.com/Pages/cml-5282LITE.html</a>) running uClinux 2.6.9<br />>> with LM75 and DS1621 temperature sensor chips. As advised by David<br />>> McCullough, the code will be incorporated in the next uClinux<br />> release.<br />> <br />>> The patch contains:<br />>><br />>> linux/drivers/i2c/busses<br />>> i2c-mcf5282.c (new file)<br />>> i2c-mcf5282.h (new file)<br />>> Kconfig (modified)<br />>> Makefile (modified)<br /><br />It also includes Kconfig.orig & Makefile.orig &<br />m528xsim.h.orig .<br />You should use<br /> diff -X dontdiff<br />where dontdiff is a filename to exclude the listed files,<br />where dontdiff includes *.orig .<br />There is a fairly up-to-date dontdiff file available at<br /><a href="http://developer.osdl.org/rddunlap/doc/dontdiff-osdl">http://developer.osdl.org/rddunlap/doc/dontdiff-osdl</a><br /><br />A diffstat summary would (hereby requested in the future)<br />would let us see which files are modified and how much<br />they are modified:<br /><br /> drivers/i2c/busses/Kconfig | 10<br /> drivers/i2c/busses/Kconfig.orig | 489 <br />++++++++++++++++++++++++++++++++++<br /> drivers/i2c/busses/Makefile | 2<br /> drivers/i2c/busses/Makefile.orig | 46 +++<br /> drivers/i2c/busses/i2c-mcf5282.c | 407 <br />++++++++++++++++++++++++++++<br /> drivers/i2c/busses/i2c-mcf5282.h | 45 +++<br /> include/asm-m68knommu/m528xsim.h | 112 +++++++<br /> include/asm-m68knommu/m528xsim.h.orig | 45 +++<br /> 8 files changed, 1156 insertions(+)<br /><br /><br />>> <br />>> linux/include/asm-m68knommu<br />>> m528xsim.h (modified)<br />>><br />>> Please let me know if you have any questions.<br />> <br />> <br />> The patch was very wordwrapped by your email client. Please fix that up<br />> (first email the patch to yourself and test that the result still<br />> applies OK) or<br />> resend as an email attachment.<br /><br />linux_dev/include/asm-m68knommu/m528xsim.h:<br /><br />some spaces in this expression (& elsewhere) would make it<br />easier to read:<br />+#define MCF5282_I2C_I2ADR_ADDR(x) <br />(((x)&0x7F)<<0x01)<br /><br />Oh, it's not even used.... don't need it then.<br />And this one is not used:<br />+#define MCF5282_I2C_I2FDR_IC(x) (((x)&0x3F))<br /><br />Lots of the bit-level definitions aren't used and usually aren't<br />added unless used.<br /><br />Comment (7) doesn't match name (hm, and it's not used):<br />+/* Interrupt Control Register 7 */<br />+#define MCF5282_INTC0_ICR17 (volatile u8 *) (MCF_IPSBAR + 0x0C51)<br /><br />These are not used -- but if they were, we generally like to<br />have macro expressions wrapped in parentheses:<br />+#define MCF5282_QSPI_QMR MCF_IPSBAR + 0x0340<br />+#define MCF5282_QSPI_QDLYR MCF_IPSBAR + 0x0344<br />+#define MCF5282_QSPI_QWR MCF_IPSBAR + 0x0348<br />+#define MCF5282_QSPI_QIR MCF_IPSBAR + 0x034C<br />+#define MCF5282_QSPI_QAR MCF_IPSBAR + 0x0350<br />+#define MCF5282_QSPI_QDR MCF_IPSBAR + 0x0354<br />+#define MCF5282_QSPI_QCR MCF_IPSBAR + 0x0354<br /><br />i2c-mcf5282.h:<br /><br />Please limit line lengths to 80 characters in source files: e.g.:<br />+static int mcf5282_i2c_start(const char read_write, const u16 <br />target_address, const enum I2C_START_TYPE i2c_start);<br /><br />What is this one for?<br />+void dumpReg(char *, u16 addr, u8 data);<br /><br /><br />I'm looking over the primary .c file separately now.<br /><br />-- <br />~Randy<br />-<br />To unsubscribe from this list: send the line "unsubscribe linux-kernel" in<br />the body of a message to majordomo@vger.kernel.org<br />More majordomo info at <a href="http://vger.kernel.org/majordomo-info.html">http://vger.kernel.org/majordomo-info.html</a><br />Please read the FAQ at <a href="http://www.tux.org/lkml/">http://www.tux.org/lkml/</a><br /><br /></pre></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerr.gif" width="32" height="32" alt="\" /></td></tr><tr><td align="right" valign="bottom"> 聽 </td></tr><tr><td align="right" valign="bottom">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerl.gif" width="32" height="32" alt="\" /></td><td class="c">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerr.gif" width="32" height="32" alt="/" /></td></tr><tr><td align="right" valign="top" colspan="2"> 聽 </td><td class="lm">Last update: 2005-04-06 13:31 聽聽 [from the cache]<br />漏2003-2020 <a href="http://blog.jasper.es/"><span itemprop="editor">Jasper Spaans</span></a>|hosted at <a href="https://www.digitalocean.com/?refcode=9a8e99d24cf9">Digital Ocean</a> and my Meterkast|<a href="http://blog.jasper.es/categories.html#lkml-ref">Read the blog</a></td><td>聽</td></tr></table><script language="javascript" src="/js/styleswitcher.js" type="text/javascript"></script></body></html>