aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-29 21:14:05 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-29 21:14:05 -0500
commit5488ace40be22d3f23f58190ae48b2c8d4691f2b (patch)
tree657ebb2cba451fa9925ddaa3947d96378bdbe40a
parent05986e264ee638b6b6151aea89c9f191278c30f1 (diff)
parent7cbcf22548df1f1df7c6b0d0bda579b92efca63c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: driver-core: fix kernel-doc parameter name UIO: Add missing documentation of features added recently Sync patch for jp_JP/stable_kernel_rules.txt
-rw-r--r--Documentation/DocBook/uio-howto.tmpl88
-rw-r--r--Documentation/ja_JP/stable_kernel_rules.txt15
-rw-r--r--drivers/base/core.c2
3 files changed, 99 insertions, 6 deletions
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl
index b787e4721c90..52e1b79ce0e6 100644
--- a/Documentation/DocBook/uio-howto.tmpl
+++ b/Documentation/DocBook/uio-howto.tmpl
@@ -42,6 +42,12 @@ GPL version 2.
42 42
43<revhistory> 43<revhistory>
44 <revision> 44 <revision>
45 <revnumber>0.7</revnumber>
46 <date>2008-12-23</date>
47 <authorinitials>hjk</authorinitials>
48 <revremark>Added generic platform drivers and offset attribute.</revremark>
49 </revision>
50 <revision>
45 <revnumber>0.6</revnumber> 51 <revnumber>0.6</revnumber>
46 <date>2008-12-05</date> 52 <date>2008-12-05</date>
47 <authorinitials>hjk</authorinitials> 53 <authorinitials>hjk</authorinitials>
@@ -312,6 +318,16 @@ interested in translating it, please email me
312 pointed to by addr. 318 pointed to by addr.
313 </para> 319 </para>
314</listitem> 320</listitem>
321<listitem>
322 <para>
323 <filename>offset</filename>: The offset, in bytes, that has to be
324 added to the pointer returned by <function>mmap()</function> to get
325 to the actual device memory. This is important if the device's memory
326 is not page aligned. Remember that pointers returned by
327 <function>mmap()</function> are always page aligned, so it is good
328 style to always add this offset.
329 </para>
330</listitem>
315</itemizedlist> 331</itemizedlist>
316 332
317<para> 333<para>
@@ -594,6 +610,78 @@ framework to set up sysfs files for this region. Simply leave it alone.
594 </para> 610 </para>
595</sect1> 611</sect1>
596 612
613<sect1 id="using_uio_pdrv">
614<title>Using uio_pdrv for platform devices</title>
615 <para>
616 In many cases, UIO drivers for platform devices can be handled in a
617 generic way. In the same place where you define your
618 <varname>struct platform_device</varname>, you simply also implement
619 your interrupt handler and fill your
620 <varname>struct uio_info</varname>. A pointer to this
621 <varname>struct uio_info</varname> is then used as
622 <varname>platform_data</varname> for your platform device.
623 </para>
624 <para>
625 You also need to set up an array of <varname>struct resource</varname>
626 containing addresses and sizes of your memory mappings. This
627 information is passed to the driver using the
628 <varname>.resource</varname> and <varname>.num_resources</varname>
629 elements of <varname>struct platform_device</varname>.
630 </para>
631 <para>
632 You now have to set the <varname>.name</varname> element of
633 <varname>struct platform_device</varname> to
634 <varname>"uio_pdrv"</varname> to use the generic UIO platform device
635 driver. This driver will fill the <varname>mem[]</varname> array
636 according to the resources given, and register the device.
637 </para>
638 <para>
639 The advantage of this approach is that you only have to edit a file
640 you need to edit anyway. You do not have to create an extra driver.
641 </para>
642</sect1>
643
644<sect1 id="using_uio_pdrv_genirq">
645<title>Using uio_pdrv_genirq for platform devices</title>
646 <para>
647 Especially in embedded devices, you frequently find chips where the
648 irq pin is tied to its own dedicated interrupt line. In such cases,
649 where you can be really sure the interrupt is not shared, we can take
650 the concept of <varname>uio_pdrv</varname> one step further and use a
651 generic interrupt handler. That's what
652 <varname>uio_pdrv_genirq</varname> does.
653 </para>
654 <para>
655 The setup for this driver is the same as described above for
656 <varname>uio_pdrv</varname>, except that you do not implement an
657 interrupt handler. The <varname>.handler</varname> element of
658 <varname>struct uio_info</varname> must remain
659 <varname>NULL</varname>. The <varname>.irq_flags</varname> element
660 must not contain <varname>IRQF_SHARED</varname>.
661 </para>
662 <para>
663 You will set the <varname>.name</varname> element of
664 <varname>struct platform_device</varname> to
665 <varname>"uio_pdrv_genirq"</varname> to use this driver.
666 </para>
667 <para>
668 The generic interrupt handler of <varname>uio_pdrv_genirq</varname>
669 will simply disable the interrupt line using
670 <function>disable_irq_nosync()</function>. After doing its work,
671 userspace can reenable the interrupt by writing 0x00000001 to the UIO
672 device file. The driver already implements an
673 <function>irq_control()</function> to make this possible, you must not
674 implement your own.
675 </para>
676 <para>
677 Using <varname>uio_pdrv_genirq</varname> not only saves a few lines of
678 interrupt handler code. You also do not need to know anything about
679 the chip's internal registers to create the kernel part of the driver.
680 All you need to know is the irq number of the pin the chip is
681 connected to.
682 </para>
683</sect1>
684
597</chapter> 685</chapter>
598 686
599<chapter id="userspace_driver" xreflabel="Writing a driver in user space"> 687<chapter id="userspace_driver" xreflabel="Writing a driver in user space">
diff --git a/Documentation/ja_JP/stable_kernel_rules.txt b/Documentation/ja_JP/stable_kernel_rules.txt
index b3ffe870de33..14265837c4ce 100644
--- a/Documentation/ja_JP/stable_kernel_rules.txt
+++ b/Documentation/ja_JP/stable_kernel_rules.txt
@@ -12,11 +12,11 @@ file at first.
12 12
13================================== 13==================================
14これは、 14これは、
15linux-2.6.24/Documentation/stable_kernel_rules.txt 15linux-2.6.29/Documentation/stable_kernel_rules.txt
16の和訳です。 16の和訳です。
17 17
18翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ > 18翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
19翻訳日: 2007/12/30 19翻訳日: 2009/1/14
20翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> 20翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com>
21校正者: 武井伸光さん、<takei at webmasters dot gr dot jp> 21校正者: 武井伸光さん、<takei at webmasters dot gr dot jp>
22 かねこさん (Seiji Kaneko) <skaneko at a2 dot mbn dot or dot jp> 22 かねこさん (Seiji Kaneko) <skaneko at a2 dot mbn dot or dot jp>
@@ -38,12 +38,15 @@ linux-2.6.24/Documentation/stable_kernel_rules.txt
38 - ビルドエラー(CONFIG_BROKENになっているものを除く), oops, ハング、デー 38 - ビルドエラー(CONFIG_BROKENになっているものを除く), oops, ハング、デー
39 タ破壊、現実のセキュリティ問題、その他 "ああ、これはダメだね"という 39 タ破壊、現実のセキュリティ問題、その他 "ああ、これはダメだね"という
40 ようなものを修正しなければならない。短く言えば、重大な問題。 40 ようなものを修正しなければならない。短く言えば、重大な問題。
41 - 新しい device ID とクオークも受け入れられる。
41 - どのように競合状態が発生するかの説明も一緒に書かれていない限り、 42 - どのように競合状態が発生するかの説明も一緒に書かれていない限り、
42 "理論的には競合状態になる"ようなものは不可。 43 "理論的には競合状態になる"ようなものは不可。
43 - いかなる些細な修正も含めることはできない。(スペルの修正、空白のクリー 44 - いかなる些細な修正も含めることはできない。(スペルの修正、空白のクリー
44 ンアップなど) 45 ンアップなど)
45 - 対応するサブシステムメンテナが受け入れたものでなければならない。
46 - Documentation/SubmittingPatches の規則に従ったものでなければならない。 46 - Documentation/SubmittingPatches の規則に従ったものでなければならない。
47 - パッチ自体か同等の修正が Linus のツリーに既に存在しなければならない。
48  Linus のツリーでのコミットID を -stable へのパッチ投稿の際に引用す
49 ること。
47 50
48-stable ツリーにパッチを送付する手続き- 51-stable ツリーにパッチを送付する手続き-
49 52
@@ -52,8 +55,10 @@ linux-2.6.24/Documentation/stable_kernel_rules.txt
52 - 送信者はパッチがキューに受け付けられた際には ACK を、却下された場合 55 - 送信者はパッチがキューに受け付けられた際には ACK を、却下された場合
53 には NAK を受け取る。この反応は開発者たちのスケジュールによって、数 56 には NAK を受け取る。この反応は開発者たちのスケジュールによって、数
54 日かかる場合がある。 57 日かかる場合がある。
55 - もし受け取られたら、パッチは他の開発者たちのレビューのために 58 - もし受け取られたら、パッチは他の開発者たちと関連するサブシステムの
56 -stable キューに追加される。 59 メンテナーによるレビューのために -stable キューに追加される。
60 - パッチに stable@kernel.org のアドレスが付加されているときには、それ
61 が Linus のツリーに入る時に自動的に stable チームに email される。
57 - セキュリティパッチはこのエイリアス (stable@kernel.org) に送られるべ 62 - セキュリティパッチはこのエイリアス (stable@kernel.org) に送られるべ
58 きではなく、代わりに security@kernel.org のアドレスに送られる。 63 きではなく、代わりに security@kernel.org のアドレスに送られる。
59 64
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 55e530942ab0..f3eae630e589 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1280,7 +1280,7 @@ EXPORT_SYMBOL_GPL(__root_device_register);
1280 1280
1281/** 1281/**
1282 * root_device_unregister - unregister and free a root device 1282 * root_device_unregister - unregister and free a root device
1283 * @root: device going away. 1283 * @dev: device going away
1284 * 1284 *
1285 * This function unregisters and cleans up a device that was created by 1285 * This function unregisters and cleans up a device that was created by
1286 * root_device_register(). 1286 * root_device_register().