================================== これは、 linux-2.6.13/Documentation/i2c/i2c-stub の和訳(ドラフト) です。 翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ > 更新日 : 2005/9/2 翻訳者 : Hiroshi.Suzuki < setter at reset dot jp > 校正者 : Masanori Kobayasi さん ================================== MODULE: i2c-stub モジュール: i2c-stub DESCRIPTION: 説明: This module is a very simple fake I2C/SMBus driver. It implements four types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, and (r/w) word data. このモジュールはとても単純な疑似 I2C/SMBus ドライバで、次の4種類の SMBus コマン ドを実装しています: 即時書き込み,バイト読み書き,バイトデータ読み書き,ワードデータ読み書き。 No hardware is needed nor associated with this module. It will accept write quick commands to all addresses; it will respond to the other commands (also to all addresses) by reading from or writing to an array in memory. It will also spam the kernel logs for every command it handles. このモジュールに関連したハードウェアもまた必要ありません。 すべてのアドレスへの即時書き込みコマンドが使え、メモリ上のひとつの配列への読み 書きにより、 (すべてのアドレスに対する) 他のコマンドに応答します。 さらに、モジュールは、扱うコマンドごとに、煩いほどのカーネルログを出すでしょう。 A pointer register with auto-increment is implemented for all byte operations. This allows for continuous byte reads like those supported by EEPROMs, among others. すべてのバイト処理のために、自動加算機能付ポインタレジスタが実装されています。 特に、EEPROM でサポートされているような、連続的なバイト読み込みを考慮しています。 The typical use-case is like this: 1. load this module 2. use i2cset (from lm_sensors project) to pre-load some data 3. load the target sensors chip driver module 4. observe its behavior in the kernel log 一般的な使い方は、次のようになります: 1. このモジュールを組み込みます 2. いくつかのデータをあらかじめ読み込むため、(lm_sensors プロジェクトの) i2cset を使います。 3. 対象のセンサーチップドライバモジュールを組み込みます 4. カーネルログで、動作を確認します CAVEATS: 注意事項: There are independent arrays for byte/data and word/data commands. Depending on if/how a target driver mixes them, you'll need to be careful. バイト/データ、ワード/データそれぞれのコマンド用に独立した配列があります。 どのように対象ドライバがそれらを混ぜるかよっては、注意が必要でしょう。 If your target driver polls some byte or word waiting for it to change, the stub could lock it up. Use i2cset to unlock it. 対象ドライバが、あるバイト、またはワードを見ながらその変化を待つとき、スタブは (バイトまたはワードを) ロックできます。ロックを解除するには、i2cset を使います。 If the hardware for your driver has banked registers (e.g. Winbond sensors chips) this module will not work well - although it could be extended to support that pretty easily. ドライバが使うハードウェアに、バンク化されたレジスタがある場合 (例えば、Winbond センサーチップ)、モジュールはうまく動きません。ですが、それをサポートするための 拡張はとても簡単にできます。 If you spam it hard enough, printk can be lossy. This module really wants something like relayfs. 極端にたくさんのログを発生した場合、printk が失われがちになるかもしれません。 そのため、このモジュールは、relayfs のようなものを本当に必要としています。