mirror of https://gitee.com/openkylin/linux.git
Merge branch 'linus' into x86/apic
Merge reason: new intr-remap patches depend on the s2ram iommu fixes from upstream Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
commit
5043124e66
|
@ -1,4 +1,4 @@
|
||||||
What: /debug/pktcdvd/pktcdvd[0-7]
|
What: /sys/kernel/debug/pktcdvd/pktcdvd[0-7]
|
||||||
Date: Oct. 2006
|
Date: Oct. 2006
|
||||||
KernelVersion: 2.6.20
|
KernelVersion: 2.6.20
|
||||||
Contact: Thomas Maier <balagi@justmail.de>
|
Contact: Thomas Maier <balagi@justmail.de>
|
||||||
|
@ -10,10 +10,10 @@ debugfs interface
|
||||||
The pktcdvd module (packet writing driver) creates
|
The pktcdvd module (packet writing driver) creates
|
||||||
these files in debugfs:
|
these files in debugfs:
|
||||||
|
|
||||||
/debug/pktcdvd/pktcdvd[0-7]/
|
/sys/kernel/debug/pktcdvd/pktcdvd[0-7]/
|
||||||
info (0444) Lots of driver statistics and infos.
|
info (0444) Lots of driver statistics and infos.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
-------
|
-------
|
||||||
|
|
||||||
cat /debug/pktcdvd/pktcdvd0/info
|
cat /sys/kernel/debug/pktcdvd/pktcdvd0/info
|
||||||
|
|
|
@ -31,7 +31,7 @@ PS_METHOD = $(prefer-db2x)
|
||||||
|
|
||||||
###
|
###
|
||||||
# The targets that may be used.
|
# The targets that may be used.
|
||||||
PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs
|
PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs
|
||||||
|
|
||||||
BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
|
BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
|
||||||
xmldocs: $(BOOKS)
|
xmldocs: $(BOOKS)
|
||||||
|
@ -213,11 +213,12 @@ silent_gen_xml = :
|
||||||
dochelp:
|
dochelp:
|
||||||
@echo ' Linux kernel internal documentation in different formats:'
|
@echo ' Linux kernel internal documentation in different formats:'
|
||||||
@echo ' htmldocs - HTML'
|
@echo ' htmldocs - HTML'
|
||||||
@echo ' installmandocs - install man pages generated by mandocs'
|
|
||||||
@echo ' mandocs - man pages'
|
|
||||||
@echo ' pdfdocs - PDF'
|
@echo ' pdfdocs - PDF'
|
||||||
@echo ' psdocs - Postscript'
|
@echo ' psdocs - Postscript'
|
||||||
@echo ' xmldocs - XML DocBook'
|
@echo ' xmldocs - XML DocBook'
|
||||||
|
@echo ' mandocs - man pages'
|
||||||
|
@echo ' installmandocs - install man pages generated by mandocs'
|
||||||
|
@echo ' cleandocs - clean all generated DocBook files'
|
||||||
|
|
||||||
###
|
###
|
||||||
# Temporary files left by various tools
|
# Temporary files left by various tools
|
||||||
|
@ -235,6 +236,10 @@ clean-files := $(DOCBOOKS) \
|
||||||
|
|
||||||
clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
|
clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
|
||||||
|
|
||||||
|
cleandocs:
|
||||||
|
$(Q)rm -f $(call objectify, $(clean-files))
|
||||||
|
$(Q)rm -rf $(call objectify, $(clean-dirs))
|
||||||
|
|
||||||
# Declare the contents of the .PHONY variable as phony. We keep that
|
# Declare the contents of the .PHONY variable as phony. We keep that
|
||||||
# information in a variable se we can use it in if_changed and friends.
|
# information in a variable se we can use it in if_changed and friends.
|
||||||
|
|
||||||
|
|
|
@ -1040,23 +1040,21 @@ Front merges are handled by the binary trees in AS and deadline schedulers.
|
||||||
iii. Plugging the queue to batch requests in anticipation of opportunities for
|
iii. Plugging the queue to batch requests in anticipation of opportunities for
|
||||||
merge/sort optimizations
|
merge/sort optimizations
|
||||||
|
|
||||||
This is just the same as in 2.4 so far, though per-device unplugging
|
|
||||||
support is anticipated for 2.5. Also with a priority-based i/o scheduler,
|
|
||||||
such decisions could be based on request priorities.
|
|
||||||
|
|
||||||
Plugging is an approach that the current i/o scheduling algorithm resorts to so
|
Plugging is an approach that the current i/o scheduling algorithm resorts to so
|
||||||
that it collects up enough requests in the queue to be able to take
|
that it collects up enough requests in the queue to be able to take
|
||||||
advantage of the sorting/merging logic in the elevator. If the
|
advantage of the sorting/merging logic in the elevator. If the
|
||||||
queue is empty when a request comes in, then it plugs the request queue
|
queue is empty when a request comes in, then it plugs the request queue
|
||||||
(sort of like plugging the bottom of a vessel to get fluid to build up)
|
(sort of like plugging the bath tub of a vessel to get fluid to build up)
|
||||||
till it fills up with a few more requests, before starting to service
|
till it fills up with a few more requests, before starting to service
|
||||||
the requests. This provides an opportunity to merge/sort the requests before
|
the requests. This provides an opportunity to merge/sort the requests before
|
||||||
passing them down to the device. There are various conditions when the queue is
|
passing them down to the device. There are various conditions when the queue is
|
||||||
unplugged (to open up the flow again), either through a scheduled task or
|
unplugged (to open up the flow again), either through a scheduled task or
|
||||||
could be on demand. For example wait_on_buffer sets the unplugging going
|
could be on demand. For example wait_on_buffer sets the unplugging going
|
||||||
(by running tq_disk) so the read gets satisfied soon. So in the read case,
|
through sync_buffer() running blk_run_address_space(mapping). Or the caller
|
||||||
the queue gets explicitly unplugged as part of waiting for completion,
|
can do it explicity through blk_unplug(bdev). So in the read case,
|
||||||
in fact all queues get unplugged as a side-effect.
|
the queue gets explicitly unplugged as part of waiting for completion on that
|
||||||
|
buffer. For page driven IO, the address space ->sync_page() takes care of
|
||||||
|
doing the blk_run_address_space().
|
||||||
|
|
||||||
Aside:
|
Aside:
|
||||||
This is kind of controversial territory, as it's not clear if plugging is
|
This is kind of controversial territory, as it's not clear if plugging is
|
||||||
|
@ -1067,11 +1065,6 @@ Aside:
|
||||||
multi-page bios being queued in one shot, we may not need to wait to merge
|
multi-page bios being queued in one shot, we may not need to wait to merge
|
||||||
a big request from the broken up pieces coming by.
|
a big request from the broken up pieces coming by.
|
||||||
|
|
||||||
Per-queue granularity unplugging (still a Todo) may help reduce some of the
|
|
||||||
concerns with just a single tq_disk flush approach. Something like
|
|
||||||
blk_kick_queue() to unplug a specific queue (right away ?)
|
|
||||||
or optionally, all queues, is in the plan.
|
|
||||||
|
|
||||||
4.4 I/O contexts
|
4.4 I/O contexts
|
||||||
I/O contexts provide a dynamically allocated per process data area. They may
|
I/O contexts provide a dynamically allocated per process data area. They may
|
||||||
be used in I/O schedulers, and in the block layer (could be used for IO statis,
|
be used in I/O schedulers, and in the block layer (could be used for IO statis,
|
||||||
|
|
|
@ -30,3 +30,21 @@ The above steps create a new group g1 and move the current shell
|
||||||
process (bash) into it. CPU time consumed by this bash and its children
|
process (bash) into it. CPU time consumed by this bash and its children
|
||||||
can be obtained from g1/cpuacct.usage and the same is accumulated in
|
can be obtained from g1/cpuacct.usage and the same is accumulated in
|
||||||
/cgroups/cpuacct.usage also.
|
/cgroups/cpuacct.usage also.
|
||||||
|
|
||||||
|
cpuacct.stat file lists a few statistics which further divide the
|
||||||
|
CPU time obtained by the cgroup into user and system times. Currently
|
||||||
|
the following statistics are supported:
|
||||||
|
|
||||||
|
user: Time spent by tasks of the cgroup in user mode.
|
||||||
|
system: Time spent by tasks of the cgroup in kernel mode.
|
||||||
|
|
||||||
|
user and system are in USER_HZ unit.
|
||||||
|
|
||||||
|
cpuacct controller uses percpu_counter interface to collect user and
|
||||||
|
system times. This has two side effects:
|
||||||
|
|
||||||
|
- It is theoretically possible to see wrong values for user and system times.
|
||||||
|
This is because percpu_counter_read() on 32bit systems isn't safe
|
||||||
|
against concurrent writes.
|
||||||
|
- It is possible to see slightly outdated values for user and system times
|
||||||
|
due to the batch processing nature of percpu_counter.
|
||||||
|
|
|
@ -6,15 +6,14 @@ used here with the memory controller that is used in hardware.
|
||||||
|
|
||||||
Salient features
|
Salient features
|
||||||
|
|
||||||
a. Enable control of both RSS (mapped) and Page Cache (unmapped) pages
|
a. Enable control of Anonymous, Page Cache (mapped and unmapped) and
|
||||||
|
Swap Cache memory pages.
|
||||||
b. The infrastructure allows easy addition of other types of memory to control
|
b. The infrastructure allows easy addition of other types of memory to control
|
||||||
c. Provides *zero overhead* for non memory controller users
|
c. Provides *zero overhead* for non memory controller users
|
||||||
d. Provides a double LRU: global memory pressure causes reclaim from the
|
d. Provides a double LRU: global memory pressure causes reclaim from the
|
||||||
global LRU; a cgroup on hitting a limit, reclaims from the per
|
global LRU; a cgroup on hitting a limit, reclaims from the per
|
||||||
cgroup LRU
|
cgroup LRU
|
||||||
|
|
||||||
NOTE: Swap Cache (unmapped) is not accounted now.
|
|
||||||
|
|
||||||
Benefits and Purpose of the memory controller
|
Benefits and Purpose of the memory controller
|
||||||
|
|
||||||
The memory controller isolates the memory behaviour of a group of tasks
|
The memory controller isolates the memory behaviour of a group of tasks
|
||||||
|
@ -290,34 +289,44 @@ will be charged as a new owner of it.
|
||||||
moved to the parent. If you want to avoid that, force_empty will be useful.
|
moved to the parent. If you want to avoid that, force_empty will be useful.
|
||||||
|
|
||||||
5.2 stat file
|
5.2 stat file
|
||||||
memory.stat file includes following statistics (now)
|
|
||||||
cache - # of pages from page-cache and shmem.
|
|
||||||
rss - # of pages from anonymous memory.
|
|
||||||
pgpgin - # of event of charging
|
|
||||||
pgpgout - # of event of uncharging
|
|
||||||
active_anon - # of pages on active lru of anon, shmem.
|
|
||||||
inactive_anon - # of pages on active lru of anon, shmem
|
|
||||||
active_file - # of pages on active lru of file-cache
|
|
||||||
inactive_file - # of pages on inactive lru of file cache
|
|
||||||
unevictable - # of pages cannot be reclaimed.(mlocked etc)
|
|
||||||
|
|
||||||
Below is depend on CONFIG_DEBUG_VM.
|
memory.stat file includes following statistics
|
||||||
inactive_ratio - VM internal parameter. (see mm/page_alloc.c)
|
|
||||||
recent_rotated_anon - VM internal parameter. (see mm/vmscan.c)
|
|
||||||
recent_rotated_file - VM internal parameter. (see mm/vmscan.c)
|
|
||||||
recent_scanned_anon - VM internal parameter. (see mm/vmscan.c)
|
|
||||||
recent_scanned_file - VM internal parameter. (see mm/vmscan.c)
|
|
||||||
|
|
||||||
Memo:
|
cache - # of bytes of page cache memory.
|
||||||
|
rss - # of bytes of anonymous and swap cache memory.
|
||||||
|
pgpgin - # of pages paged in (equivalent to # of charging events).
|
||||||
|
pgpgout - # of pages paged out (equivalent to # of uncharging events).
|
||||||
|
active_anon - # of bytes of anonymous and swap cache memory on active
|
||||||
|
lru list.
|
||||||
|
inactive_anon - # of bytes of anonymous memory and swap cache memory on
|
||||||
|
inactive lru list.
|
||||||
|
active_file - # of bytes of file-backed memory on active lru list.
|
||||||
|
inactive_file - # of bytes of file-backed memory on inactive lru list.
|
||||||
|
unevictable - # of bytes of memory that cannot be reclaimed (mlocked etc).
|
||||||
|
|
||||||
|
The following additional stats are dependent on CONFIG_DEBUG_VM.
|
||||||
|
|
||||||
|
inactive_ratio - VM internal parameter. (see mm/page_alloc.c)
|
||||||
|
recent_rotated_anon - VM internal parameter. (see mm/vmscan.c)
|
||||||
|
recent_rotated_file - VM internal parameter. (see mm/vmscan.c)
|
||||||
|
recent_scanned_anon - VM internal parameter. (see mm/vmscan.c)
|
||||||
|
recent_scanned_file - VM internal parameter. (see mm/vmscan.c)
|
||||||
|
|
||||||
|
Memo:
|
||||||
recent_rotated means recent frequency of lru rotation.
|
recent_rotated means recent frequency of lru rotation.
|
||||||
recent_scanned means recent # of scans to lru.
|
recent_scanned means recent # of scans to lru.
|
||||||
showing for better debug please see the code for meanings.
|
showing for better debug please see the code for meanings.
|
||||||
|
|
||||||
|
Note:
|
||||||
|
Only anonymous and swap cache memory is listed as part of 'rss' stat.
|
||||||
|
This should not be confused with the true 'resident set size' or the
|
||||||
|
amount of physical memory used by the cgroup. Per-cgroup rss
|
||||||
|
accounting is not done yet.
|
||||||
|
|
||||||
5.3 swappiness
|
5.3 swappiness
|
||||||
Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only.
|
Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only.
|
||||||
|
|
||||||
Following cgroup's swapiness can't be changed.
|
Following cgroups' swapiness can't be changed.
|
||||||
- root cgroup (uses /proc/sys/vm/swappiness).
|
- root cgroup (uses /proc/sys/vm/swappiness).
|
||||||
- a cgroup which uses hierarchy and it has child cgroup.
|
- a cgroup which uses hierarchy and it has child cgroup.
|
||||||
- a cgroup which uses hierarchy and not the root of hierarchy.
|
- a cgroup which uses hierarchy and not the root of hierarchy.
|
||||||
|
|
|
@ -47,13 +47,18 @@ to work with it.
|
||||||
|
|
||||||
2. Basic accounting routines
|
2. Basic accounting routines
|
||||||
|
|
||||||
a. void res_counter_init(struct res_counter *rc)
|
a. void res_counter_init(struct res_counter *rc,
|
||||||
|
struct res_counter *rc_parent)
|
||||||
|
|
||||||
Initializes the resource counter. As usual, should be the first
|
Initializes the resource counter. As usual, should be the first
|
||||||
routine called for a new counter.
|
routine called for a new counter.
|
||||||
|
|
||||||
b. int res_counter_charge[_locked]
|
The struct res_counter *parent can be used to define a hierarchical
|
||||||
(struct res_counter *rc, unsigned long val)
|
child -> parent relationship directly in the res_counter structure,
|
||||||
|
NULL can be used to define no relationship.
|
||||||
|
|
||||||
|
c. int res_counter_charge(struct res_counter *rc, unsigned long val,
|
||||||
|
struct res_counter **limit_fail_at)
|
||||||
|
|
||||||
When a resource is about to be allocated it has to be accounted
|
When a resource is about to be allocated it has to be accounted
|
||||||
with the appropriate resource counter (controller should determine
|
with the appropriate resource counter (controller should determine
|
||||||
|
@ -67,15 +72,25 @@ to work with it.
|
||||||
* if the charging is performed first, then it should be uncharged
|
* if the charging is performed first, then it should be uncharged
|
||||||
on error path (if the one is called).
|
on error path (if the one is called).
|
||||||
|
|
||||||
c. void res_counter_uncharge[_locked]
|
If the charging fails and a hierarchical dependency exists, the
|
||||||
|
limit_fail_at parameter is set to the particular res_counter element
|
||||||
|
where the charging failed.
|
||||||
|
|
||||||
|
d. int res_counter_charge_locked
|
||||||
|
(struct res_counter *rc, unsigned long val)
|
||||||
|
|
||||||
|
The same as res_counter_charge(), but it must not acquire/release the
|
||||||
|
res_counter->lock internally (it must be called with res_counter->lock
|
||||||
|
held).
|
||||||
|
|
||||||
|
e. void res_counter_uncharge[_locked]
|
||||||
(struct res_counter *rc, unsigned long val)
|
(struct res_counter *rc, unsigned long val)
|
||||||
|
|
||||||
When a resource is released (freed) it should be de-accounted
|
When a resource is released (freed) it should be de-accounted
|
||||||
from the resource counter it was accounted to. This is called
|
from the resource counter it was accounted to. This is called
|
||||||
"uncharging".
|
"uncharging".
|
||||||
|
|
||||||
The _locked routines imply that the res_counter->lock is taken.
|
The _locked routines imply that the res_counter->lock is taken.
|
||||||
|
|
||||||
|
|
||||||
2.1 Other accounting routines
|
2.1 Other accounting routines
|
||||||
|
|
||||||
|
|
|
@ -428,3 +428,12 @@ Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
|
||||||
After a reasonable transition period, we will remove the legacy
|
After a reasonable transition period, we will remove the legacy
|
||||||
fakephp interface.
|
fakephp interface.
|
||||||
Who: Alex Chiang <achiang@hp.com>
|
Who: Alex Chiang <achiang@hp.com>
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
What: i2c-voodoo3 driver
|
||||||
|
When: October 2009
|
||||||
|
Why: Superseded by tdfxfb. I2C/DDC support used to live in a separate
|
||||||
|
driver but this caused driver conflicts.
|
||||||
|
Who: Jean Delvare <khali@linux-fr.org>
|
||||||
|
Krzysztof Helt <krzysztof.h1@wp.pl>
|
||||||
|
|
|
@ -24,6 +24,49 @@ Partitions and P_Keys
|
||||||
The P_Key for any interface is given by the "pkey" file, and the
|
The P_Key for any interface is given by the "pkey" file, and the
|
||||||
main interface for a subinterface is in "parent."
|
main interface for a subinterface is in "parent."
|
||||||
|
|
||||||
|
Datagram vs Connected modes
|
||||||
|
|
||||||
|
The IPoIB driver supports two modes of operation: datagram and
|
||||||
|
connected. The mode is set and read through an interface's
|
||||||
|
/sys/class/net/<intf name>/mode file.
|
||||||
|
|
||||||
|
In datagram mode, the IB UD (Unreliable Datagram) transport is used
|
||||||
|
and so the interface MTU has is equal to the IB L2 MTU minus the
|
||||||
|
IPoIB encapsulation header (4 bytes). For example, in a typical IB
|
||||||
|
fabric with a 2K MTU, the IPoIB MTU will be 2048 - 4 = 2044 bytes.
|
||||||
|
|
||||||
|
In connected mode, the IB RC (Reliable Connected) transport is used.
|
||||||
|
Connected mode is to takes advantage of the connected nature of the
|
||||||
|
IB transport and allows an MTU up to the maximal IP packet size of
|
||||||
|
64K, which reduces the number of IP packets needed for handling
|
||||||
|
large UDP datagrams, TCP segments, etc and increases the performance
|
||||||
|
for large messages.
|
||||||
|
|
||||||
|
In connected mode, the interface's UD QP is still used for multicast
|
||||||
|
and communication with peers that don't support connected mode. In
|
||||||
|
this case, RX emulation of ICMP PMTU packets is used to cause the
|
||||||
|
networking stack to use the smaller UD MTU for these neighbours.
|
||||||
|
|
||||||
|
Stateless offloads
|
||||||
|
|
||||||
|
If the IB HW supports IPoIB stateless offloads, IPoIB advertises
|
||||||
|
TCP/IP checksum and/or Large Send (LSO) offloading capability to the
|
||||||
|
network stack.
|
||||||
|
|
||||||
|
Large Receive (LRO) offloading is also implemented and may be turned
|
||||||
|
on/off using ethtool calls. Currently LRO is supported only for
|
||||||
|
checksum offload capable devices.
|
||||||
|
|
||||||
|
Stateless offloads are supported only in datagram mode.
|
||||||
|
|
||||||
|
Interrupt moderation
|
||||||
|
|
||||||
|
If the underlying IB device supports CQ event moderation, one can
|
||||||
|
use ethtool to set interrupt mitigation parameters and thus reduce
|
||||||
|
the overhead incurred by handling interrupts. The main code path of
|
||||||
|
IPoIB doesn't use events for TX completion signaling so only RX
|
||||||
|
moderation is supported.
|
||||||
|
|
||||||
Debugging Information
|
Debugging Information
|
||||||
|
|
||||||
By compiling the IPoIB driver with CONFIG_INFINIBAND_IPOIB_DEBUG set
|
By compiling the IPoIB driver with CONFIG_INFINIBAND_IPOIB_DEBUG set
|
||||||
|
@ -55,3 +98,5 @@ References
|
||||||
http://ietf.org/rfc/rfc4391.txt
|
http://ietf.org/rfc/rfc4391.txt
|
||||||
IP over InfiniBand (IPoIB) Architecture (RFC 4392)
|
IP over InfiniBand (IPoIB) Architecture (RFC 4392)
|
||||||
http://ietf.org/rfc/rfc4392.txt
|
http://ietf.org/rfc/rfc4392.txt
|
||||||
|
IP over InfiniBand: Connected Mode (RFC 4755)
|
||||||
|
http://ietf.org/rfc/rfc4755.txt
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
rotary-encoder - a generic driver for GPIO connected devices
|
||||||
|
Daniel Mack <daniel@caiaq.de>, Feb 2009
|
||||||
|
|
||||||
|
0. Function
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Rotary encoders are devices which are connected to the CPU or other
|
||||||
|
peripherals with two wires. The outputs are phase-shifted by 90 degrees
|
||||||
|
and by triggering on falling and rising edges, the turn direction can
|
||||||
|
be determined.
|
||||||
|
|
||||||
|
The phase diagram of these two outputs look like this:
|
||||||
|
|
||||||
|
_____ _____ _____
|
||||||
|
| | | | | |
|
||||||
|
Channel A ____| |_____| |_____| |____
|
||||||
|
|
||||||
|
: : : : : : : : : : : :
|
||||||
|
__ _____ _____ _____
|
||||||
|
| | | | | | |
|
||||||
|
Channel B |_____| |_____| |_____| |__
|
||||||
|
|
||||||
|
: : : : : : : : : : : :
|
||||||
|
Event a b c d a b c d a b c d
|
||||||
|
|
||||||
|
|<-------->|
|
||||||
|
one step
|
||||||
|
|
||||||
|
|
||||||
|
For more information, please see
|
||||||
|
http://en.wikipedia.org/wiki/Rotary_encoder
|
||||||
|
|
||||||
|
|
||||||
|
1. Events / state machine
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
a) Rising edge on channel A, channel B in low state
|
||||||
|
This state is used to recognize a clockwise turn
|
||||||
|
|
||||||
|
b) Rising edge on channel B, channel A in high state
|
||||||
|
When entering this state, the encoder is put into 'armed' state,
|
||||||
|
meaning that there it has seen half the way of a one-step transition.
|
||||||
|
|
||||||
|
c) Falling edge on channel A, channel B in high state
|
||||||
|
This state is used to recognize a counter-clockwise turn
|
||||||
|
|
||||||
|
d) Falling edge on channel B, channel A in low state
|
||||||
|
Parking position. If the encoder enters this state, a full transition
|
||||||
|
should have happend, unless it flipped back on half the way. The
|
||||||
|
'armed' state tells us about that.
|
||||||
|
|
||||||
|
2. Platform requirements
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
As there is no hardware dependent call in this driver, the platform it is
|
||||||
|
used with must support gpiolib. Another requirement is that IRQs must be
|
||||||
|
able to fire on both edges.
|
||||||
|
|
||||||
|
|
||||||
|
3. Board integration
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
To use this driver in your system, register a platform_device with the
|
||||||
|
name 'rotary-encoder' and associate the IRQs and some specific platform
|
||||||
|
data with it.
|
||||||
|
|
||||||
|
struct rotary_encoder_platform_data is declared in
|
||||||
|
include/linux/rotary-encoder.h and needs to be filled with the number of
|
||||||
|
steps the encoder has and can carry information about externally inverted
|
||||||
|
signals (because of used invertig buffer or other reasons).
|
||||||
|
|
||||||
|
Because GPIO to IRQ mapping is platform specific, this information must
|
||||||
|
be given in seperately to the driver. See the example below.
|
||||||
|
|
||||||
|
---------<snip>---------
|
||||||
|
|
||||||
|
/* board support file example */
|
||||||
|
|
||||||
|
#include <linux/input.h>
|
||||||
|
#include <linux/rotary_encoder.h>
|
||||||
|
|
||||||
|
#define GPIO_ROTARY_A 1
|
||||||
|
#define GPIO_ROTARY_B 2
|
||||||
|
|
||||||
|
static struct rotary_encoder_platform_data my_rotary_encoder_info = {
|
||||||
|
.steps = 24,
|
||||||
|
.axis = ABS_X,
|
||||||
|
.gpio_a = GPIO_ROTARY_A,
|
||||||
|
.gpio_b = GPIO_ROTARY_B,
|
||||||
|
.inverted_a = 0,
|
||||||
|
.inverted_b = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device rotary_encoder_device = {
|
||||||
|
.name = "rotary-encoder",
|
||||||
|
.id = 0,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = &my_rotary_encoder_info,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
@ -40,10 +40,16 @@ This document describes the Linux kernel Makefiles.
|
||||||
--- 6.7 Custom kbuild commands
|
--- 6.7 Custom kbuild commands
|
||||||
--- 6.8 Preprocessing linker scripts
|
--- 6.8 Preprocessing linker scripts
|
||||||
|
|
||||||
=== 7 Kbuild Variables
|
=== 7 Kbuild syntax for exported headers
|
||||||
=== 8 Makefile language
|
--- 7.1 header-y
|
||||||
=== 9 Credits
|
--- 7.2 objhdr-y
|
||||||
=== 10 TODO
|
--- 7.3 destination-y
|
||||||
|
--- 7.4 unifdef-y (deprecated)
|
||||||
|
|
||||||
|
=== 8 Kbuild Variables
|
||||||
|
=== 9 Makefile language
|
||||||
|
=== 10 Credits
|
||||||
|
=== 11 TODO
|
||||||
|
|
||||||
=== 1 Overview
|
=== 1 Overview
|
||||||
|
|
||||||
|
@ -1143,8 +1149,69 @@ When kbuild executes, the following steps are followed (roughly):
|
||||||
The kbuild infrastructure for *lds file are used in several
|
The kbuild infrastructure for *lds file are used in several
|
||||||
architecture-specific files.
|
architecture-specific files.
|
||||||
|
|
||||||
|
=== 7 Kbuild syntax for exported headers
|
||||||
|
|
||||||
=== 7 Kbuild Variables
|
The kernel include a set of headers that is exported to userspace.
|
||||||
|
Many headers can be exported as-is but other headers requires a
|
||||||
|
minimal pre-processing before they are ready for user-space.
|
||||||
|
The pre-processing does:
|
||||||
|
- drop kernel specific annotations
|
||||||
|
- drop include of compiler.h
|
||||||
|
- drop all sections that is kernel internat (guarded by ifdef __KERNEL__)
|
||||||
|
|
||||||
|
Each relevant directory contain a file name "Kbuild" which specify the
|
||||||
|
headers to be exported.
|
||||||
|
See subsequent chapter for the syntax of the Kbuild file.
|
||||||
|
|
||||||
|
--- 7.1 header-y
|
||||||
|
|
||||||
|
header-y specify header files to be exported.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
#include/linux/Kbuild
|
||||||
|
header-y += usb/
|
||||||
|
header-y += aio_abi.h
|
||||||
|
|
||||||
|
The convention is to list one file per line and
|
||||||
|
preferably in alphabetic order.
|
||||||
|
|
||||||
|
header-y also specify which subdirectories to visit.
|
||||||
|
A subdirectory is identified by a trailing '/' which
|
||||||
|
can be seen in the example above for the usb subdirectory.
|
||||||
|
|
||||||
|
Subdirectories are visited before their parent directories.
|
||||||
|
|
||||||
|
--- 7.2 objhdr-y
|
||||||
|
|
||||||
|
objhdr-y specifies generated files to be exported.
|
||||||
|
Generated files are special as they need to be looked
|
||||||
|
up in another directory when doing 'make O=...' builds.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
#include/linux/Kbuild
|
||||||
|
objhdr-y += version.h
|
||||||
|
|
||||||
|
--- 7.3 destination-y
|
||||||
|
|
||||||
|
When an architecture have a set of exported headers that needs to be
|
||||||
|
exported to a different directory destination-y is used.
|
||||||
|
destination-y specify the destination directory for all exported
|
||||||
|
headers in the file where it is present.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
#arch/xtensa/platforms/s6105/include/platform/Kbuild
|
||||||
|
destination-y := include/linux
|
||||||
|
|
||||||
|
In the example above all exported headers in the Kbuild file
|
||||||
|
will be located in the directory "include/linux" when exported.
|
||||||
|
|
||||||
|
|
||||||
|
--- 7.4 unifdef-y (deprecated)
|
||||||
|
|
||||||
|
unifdef-y is deprecated. A direct replacement is header-y.
|
||||||
|
|
||||||
|
|
||||||
|
=== 8 Kbuild Variables
|
||||||
|
|
||||||
The top Makefile exports the following variables:
|
The top Makefile exports the following variables:
|
||||||
|
|
||||||
|
@ -1206,7 +1273,7 @@ The top Makefile exports the following variables:
|
||||||
INSTALL_MOD_STRIP will used as the option(s) to the strip command.
|
INSTALL_MOD_STRIP will used as the option(s) to the strip command.
|
||||||
|
|
||||||
|
|
||||||
=== 8 Makefile language
|
=== 9 Makefile language
|
||||||
|
|
||||||
The kernel Makefiles are designed to be run with GNU Make. The Makefiles
|
The kernel Makefiles are designed to be run with GNU Make. The Makefiles
|
||||||
use only the documented features of GNU Make, but they do use many
|
use only the documented features of GNU Make, but they do use many
|
||||||
|
@ -1225,14 +1292,14 @@ time the left-hand side is used.
|
||||||
There are some cases where "=" is appropriate. Usually, though, ":="
|
There are some cases where "=" is appropriate. Usually, though, ":="
|
||||||
is the right choice.
|
is the right choice.
|
||||||
|
|
||||||
=== 9 Credits
|
=== 10 Credits
|
||||||
|
|
||||||
Original version made by Michael Elizabeth Chastain, <mailto:mec@shout.net>
|
Original version made by Michael Elizabeth Chastain, <mailto:mec@shout.net>
|
||||||
Updates by Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
|
Updates by Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
|
||||||
Updates by Sam Ravnborg <sam@ravnborg.org>
|
Updates by Sam Ravnborg <sam@ravnborg.org>
|
||||||
Language QA by Jan Engelhardt <jengelh@gmx.de>
|
Language QA by Jan Engelhardt <jengelh@gmx.de>
|
||||||
|
|
||||||
=== 10 TODO
|
=== 11 TODO
|
||||||
|
|
||||||
- Describe how kbuild supports shipped files with _shipped.
|
- Describe how kbuild supports shipped files with _shipped.
|
||||||
- Generating offset header files.
|
- Generating offset header files.
|
||||||
|
|
|
@ -1242,7 +1242,7 @@ monitoring is enabled, and vice-versa.
|
||||||
To add ARP targets:
|
To add ARP targets:
|
||||||
# echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
# echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||||
# echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target
|
# echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||||
NOTE: up to 10 target addresses may be specified.
|
NOTE: up to 16 target addresses may be specified.
|
||||||
|
|
||||||
To remove an ARP target:
|
To remove an ARP target:
|
||||||
# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||||
|
|
|
@ -7,8 +7,10 @@ Required properties :
|
||||||
|
|
||||||
Recommended properties :
|
Recommended properties :
|
||||||
|
|
||||||
- compatible : Should be "fsl-i2c" for parts compatible with
|
- compatible : compatibility list with 2 entries, the first should
|
||||||
Freescale I2C specifications.
|
be "fsl,CHIP-i2c" where CHIP is the name of a compatible processor,
|
||||||
|
e.g. mpc8313, mpc8543, mpc8544, mpc5200 or mpc5200b. The second one
|
||||||
|
should be "fsl-i2c".
|
||||||
- interrupts : <a b> where a is the interrupt number and b is a
|
- interrupts : <a b> where a is the interrupt number and b is a
|
||||||
field that represents an encoding of the sense and level
|
field that represents an encoding of the sense and level
|
||||||
information for the interrupt. This should be encoded based on
|
information for the interrupt. This should be encoded based on
|
||||||
|
@ -16,17 +18,31 @@ Recommended properties :
|
||||||
controller you have.
|
controller you have.
|
||||||
- interrupt-parent : the phandle for the interrupt controller that
|
- interrupt-parent : the phandle for the interrupt controller that
|
||||||
services interrupts for this device.
|
services interrupts for this device.
|
||||||
- dfsrr : boolean; if defined, indicates that this I2C device has
|
- fsl,preserve-clocking : boolean; if defined, the clock settings
|
||||||
a digital filter sampling rate register
|
from the bootloader are preserved (not touched).
|
||||||
- fsl5200-clocking : boolean; if defined, indicated that this device
|
- clock-frequency : desired I2C bus clock frequency in Hz.
|
||||||
uses the FSL 5200 clocking mechanism.
|
|
||||||
|
|
||||||
Example :
|
Examples :
|
||||||
i2c@3000 {
|
|
||||||
interrupt-parent = <40000>;
|
i2c@3d00 {
|
||||||
interrupts = <1b 3>;
|
#address-cells = <1>;
|
||||||
reg = <3000 18>;
|
#size-cells = <0>;
|
||||||
device_type = "i2c";
|
compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
|
||||||
compatible = "fsl-i2c";
|
cell-index = <0>;
|
||||||
dfsrr;
|
reg = <0x3d00 0x40>;
|
||||||
|
interrupts = <2 15 0>;
|
||||||
|
interrupt-parent = <&mpc5200_pic>;
|
||||||
|
fsl,preserve-clocking;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
i2c@3100 {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
cell-index = <1>;
|
||||||
|
compatible = "fsl,mpc8544-i2c", "fsl-i2c";
|
||||||
|
reg = <0x3100 0x100>;
|
||||||
|
interrupts = <43 2>;
|
||||||
|
interrupt-parent = <&mpic>;
|
||||||
|
clock-frequency = <400000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ PCI SSID look-up.
|
||||||
What `model` option values are available depends on the codec chip.
|
What `model` option values are available depends on the codec chip.
|
||||||
Check your codec chip from the codec proc file (see "Codec Proc-File"
|
Check your codec chip from the codec proc file (see "Codec Proc-File"
|
||||||
section below). It will show the vendor/product name of your codec
|
section below). It will show the vendor/product name of your codec
|
||||||
chip. Then, see Documentation/sound/alsa/HD-Audio-Modelstxt file,
|
chip. Then, see Documentation/sound/alsa/HD-Audio-Models.txt file,
|
||||||
the section of HD-audio driver. You can find a list of codecs
|
the section of HD-audio driver. You can find a list of codecs
|
||||||
and `model` options belonging to each codec. For example, for Realtek
|
and `model` options belonging to each codec. For example, for Realtek
|
||||||
ALC262 codec chip, pass `model=ultra` for devices that are compatible
|
ALC262 codec chip, pass `model=ultra` for devices that are compatible
|
||||||
|
@ -177,7 +177,7 @@ with Samsung Q1 Ultra.
|
||||||
|
|
||||||
Thus, the first thing you can do for any brand-new, unsupported and
|
Thus, the first thing you can do for any brand-new, unsupported and
|
||||||
non-working HD-audio hardware is to check HD-audio codec and several
|
non-working HD-audio hardware is to check HD-audio codec and several
|
||||||
different `model` option values. If you have a luck, some of them
|
different `model` option values. If you have any luck, some of them
|
||||||
might suit with your device well.
|
might suit with your device well.
|
||||||
|
|
||||||
Some codecs such as ALC880 have a special model option `model=test`.
|
Some codecs such as ALC880 have a special model option `model=test`.
|
||||||
|
|
|
@ -42,6 +42,14 @@ sure that bitwise types don't get mixed up (little-endian vs big-endian
|
||||||
vs cpu-endian vs whatever), and there the constant "0" really _is_
|
vs cpu-endian vs whatever), and there the constant "0" really _is_
|
||||||
special.
|
special.
|
||||||
|
|
||||||
|
__bitwise__ - to be used for relatively compact stuff (gfp_t, etc.) that
|
||||||
|
is mostly warning-free and is supposed to stay that way. Warnings will
|
||||||
|
be generated without __CHECK_ENDIAN__.
|
||||||
|
|
||||||
|
__bitwise - noisy stuff; in particular, __le*/__be* are that. We really
|
||||||
|
don't want to drown in noise unless we'd explicitly asked for it.
|
||||||
|
|
||||||
|
|
||||||
Getting sparse
|
Getting sparse
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ of struct cmsghdr structures with appended data.
|
||||||
|
|
||||||
There is only one file in this directory.
|
There is only one file in this directory.
|
||||||
unix_dgram_qlen limits the max number of datagrams queued in Unix domain
|
unix_dgram_qlen limits the max number of datagrams queued in Unix domain
|
||||||
socket's buffer. It will not take effect unless PF_UNIX flag is spicified.
|
socket's buffer. It will not take effect unless PF_UNIX flag is specified.
|
||||||
|
|
||||||
|
|
||||||
3. /proc/sys/net/ipv4 - IPV4 settings
|
3. /proc/sys/net/ipv4 - IPV4 settings
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
--- What is TOMOYO? ---
|
||||||
|
|
||||||
|
TOMOYO is a name-based MAC extension (LSM module) for the Linux kernel.
|
||||||
|
|
||||||
|
LiveCD-based tutorials are available at
|
||||||
|
http://tomoyo.sourceforge.jp/en/1.6.x/1st-step/ubuntu8.04-live/
|
||||||
|
http://tomoyo.sourceforge.jp/en/1.6.x/1st-step/centos5-live/ .
|
||||||
|
Though these tutorials use non-LSM version of TOMOYO, they are useful for you
|
||||||
|
to know what TOMOYO is.
|
||||||
|
|
||||||
|
--- How to enable TOMOYO? ---
|
||||||
|
|
||||||
|
Build the kernel with CONFIG_SECURITY_TOMOYO=y and pass "security=tomoyo" on
|
||||||
|
kernel's command line.
|
||||||
|
|
||||||
|
Please see http://tomoyo.sourceforge.jp/en/2.2.x/ for details.
|
||||||
|
|
||||||
|
--- Where is documentation? ---
|
||||||
|
|
||||||
|
User <-> Kernel interface documentation is available at
|
||||||
|
http://tomoyo.sourceforge.jp/en/2.2.x/policy-reference.html .
|
||||||
|
|
||||||
|
Materials we prepared for seminars and symposiums are available at
|
||||||
|
http://sourceforge.jp/projects/tomoyo/docs/?category_id=532&language_id=1 .
|
||||||
|
Below lists are chosen from three aspects.
|
||||||
|
|
||||||
|
What is TOMOYO?
|
||||||
|
TOMOYO Linux Overview
|
||||||
|
http://sourceforge.jp/projects/tomoyo/docs/lca2009-takeda.pdf
|
||||||
|
TOMOYO Linux: pragmatic and manageable security for Linux
|
||||||
|
http://sourceforge.jp/projects/tomoyo/docs/freedomhectaipei-tomoyo.pdf
|
||||||
|
TOMOYO Linux: A Practical Method to Understand and Protect Your Own Linux Box
|
||||||
|
http://sourceforge.jp/projects/tomoyo/docs/PacSec2007-en-no-demo.pdf
|
||||||
|
|
||||||
|
What can TOMOYO do?
|
||||||
|
Deep inside TOMOYO Linux
|
||||||
|
http://sourceforge.jp/projects/tomoyo/docs/lca2009-kumaneko.pdf
|
||||||
|
The role of "pathname based access control" in security.
|
||||||
|
http://sourceforge.jp/projects/tomoyo/docs/lfj2008-bof.pdf
|
||||||
|
|
||||||
|
History of TOMOYO?
|
||||||
|
Realities of Mainlining
|
||||||
|
http://sourceforge.jp/projects/tomoyo/docs/lfj2008.pdf
|
||||||
|
|
||||||
|
--- What is future plan? ---
|
||||||
|
|
||||||
|
We believe that inode based security and name based security are complementary
|
||||||
|
and both should be used together. But unfortunately, so far, we cannot enable
|
||||||
|
multiple LSM modules at the same time. We feel sorry that you have to give up
|
||||||
|
SELinux/SMACK/AppArmor etc. when you want to use TOMOYO.
|
||||||
|
|
||||||
|
We hope that LSM becomes stackable in future. Meanwhile, you can use non-LSM
|
||||||
|
version of TOMOYO, available at http://tomoyo.sourceforge.jp/en/1.6.x/ .
|
||||||
|
LSM version of TOMOYO is a subset of non-LSM version of TOMOYO. We are planning
|
||||||
|
to port non-LSM version's functionalities to LSM versions.
|
|
@ -1,5 +1,7 @@
|
||||||
00-INDEX
|
00-INDEX
|
||||||
- this file.
|
- this file.
|
||||||
|
active_mm.txt
|
||||||
|
- An explanation from Linus about tsk->active_mm vs tsk->mm.
|
||||||
balance
|
balance
|
||||||
- various information on memory balancing.
|
- various information on memory balancing.
|
||||||
hugetlbpage.txt
|
hugetlbpage.txt
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
List: linux-kernel
|
||||||
|
Subject: Re: active_mm
|
||||||
|
From: Linus Torvalds <torvalds () transmeta ! com>
|
||||||
|
Date: 1999-07-30 21:36:24
|
||||||
|
|
||||||
|
Cc'd to linux-kernel, because I don't write explanations all that often,
|
||||||
|
and when I do I feel better about more people reading them.
|
||||||
|
|
||||||
|
On Fri, 30 Jul 1999, David Mosberger wrote:
|
||||||
|
>
|
||||||
|
> Is there a brief description someplace on how "mm" vs. "active_mm" in
|
||||||
|
> the task_struct are supposed to be used? (My apologies if this was
|
||||||
|
> discussed on the mailing lists---I just returned from vacation and
|
||||||
|
> wasn't able to follow linux-kernel for a while).
|
||||||
|
|
||||||
|
Basically, the new setup is:
|
||||||
|
|
||||||
|
- we have "real address spaces" and "anonymous address spaces". The
|
||||||
|
difference is that an anonymous address space doesn't care about the
|
||||||
|
user-level page tables at all, so when we do a context switch into an
|
||||||
|
anonymous address space we just leave the previous address space
|
||||||
|
active.
|
||||||
|
|
||||||
|
The obvious use for a "anonymous address space" is any thread that
|
||||||
|
doesn't need any user mappings - all kernel threads basically fall into
|
||||||
|
this category, but even "real" threads can temporarily say that for
|
||||||
|
some amount of time they are not going to be interested in user space,
|
||||||
|
and that the scheduler might as well try to avoid wasting time on
|
||||||
|
switching the VM state around. Currently only the old-style bdflush
|
||||||
|
sync does that.
|
||||||
|
|
||||||
|
- "tsk->mm" points to the "real address space". For an anonymous process,
|
||||||
|
tsk->mm will be NULL, for the logical reason that an anonymous process
|
||||||
|
really doesn't _have_ a real address space at all.
|
||||||
|
|
||||||
|
- however, we obviously need to keep track of which address space we
|
||||||
|
"stole" for such an anonymous user. For that, we have "tsk->active_mm",
|
||||||
|
which shows what the currently active address space is.
|
||||||
|
|
||||||
|
The rule is that for a process with a real address space (ie tsk->mm is
|
||||||
|
non-NULL) the active_mm obviously always has to be the same as the real
|
||||||
|
one.
|
||||||
|
|
||||||
|
For a anonymous process, tsk->mm == NULL, and tsk->active_mm is the
|
||||||
|
"borrowed" mm while the anonymous process is running. When the
|
||||||
|
anonymous process gets scheduled away, the borrowed address space is
|
||||||
|
returned and cleared.
|
||||||
|
|
||||||
|
To support all that, the "struct mm_struct" now has two counters: a
|
||||||
|
"mm_users" counter that is how many "real address space users" there are,
|
||||||
|
and a "mm_count" counter that is the number of "lazy" users (ie anonymous
|
||||||
|
users) plus one if there are any real users.
|
||||||
|
|
||||||
|
Usually there is at least one real user, but it could be that the real
|
||||||
|
user exited on another CPU while a lazy user was still active, so you do
|
||||||
|
actually get cases where you have a address space that is _only_ used by
|
||||||
|
lazy users. That is often a short-lived state, because once that thread
|
||||||
|
gets scheduled away in favour of a real thread, the "zombie" mm gets
|
||||||
|
released because "mm_users" becomes zero.
|
||||||
|
|
||||||
|
Also, a new rule is that _nobody_ ever has "init_mm" as a real MM any
|
||||||
|
more. "init_mm" should be considered just a "lazy context when no other
|
||||||
|
context is available", and in fact it is mainly used just at bootup when
|
||||||
|
no real VM has yet been created. So code that used to check
|
||||||
|
|
||||||
|
if (current->mm == &init_mm)
|
||||||
|
|
||||||
|
should generally just do
|
||||||
|
|
||||||
|
if (!current->mm)
|
||||||
|
|
||||||
|
instead (which makes more sense anyway - the test is basically one of "do
|
||||||
|
we have a user context", and is generally done by the page fault handler
|
||||||
|
and things like that).
|
||||||
|
|
||||||
|
Anyway, I put a pre-patch-2.3.13-1 on ftp.kernel.org just a moment ago,
|
||||||
|
because it slightly changes the interfaces to accomodate the alpha (who
|
||||||
|
would have thought it, but the alpha actually ends up having one of the
|
||||||
|
ugliest context switch codes - unlike the other architectures where the MM
|
||||||
|
and register state is separate, the alpha PALcode joins the two, and you
|
||||||
|
need to switch both together).
|
||||||
|
|
||||||
|
(From http://marc.info/?l=linux-kernel&m=93337278602211&w=2)
|
File diff suppressed because it is too large
Load Diff
1628
MAINTAINERS
1628
MAINTAINERS
File diff suppressed because it is too large
Load Diff
17
Makefile
17
Makefile
|
@ -1,7 +1,7 @@
|
||||||
VERSION = 2
|
VERSION = 2
|
||||||
PATCHLEVEL = 6
|
PATCHLEVEL = 6
|
||||||
SUBLEVEL = 30
|
SUBLEVEL = 30
|
||||||
EXTRAVERSION = -rc1
|
EXTRAVERSION = -rc2
|
||||||
NAME = Temporary Tasmanian Devil
|
NAME = Temporary Tasmanian Devil
|
||||||
|
|
||||||
# *DOCUMENTATION*
|
# *DOCUMENTATION*
|
||||||
|
@ -169,7 +169,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
|
||||||
-e s/arm.*/arm/ -e s/sa110/arm/ \
|
-e s/arm.*/arm/ -e s/sa110/arm/ \
|
||||||
-e s/s390x/s390/ -e s/parisc64/parisc/ \
|
-e s/s390x/s390/ -e s/parisc64/parisc/ \
|
||||||
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
|
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
|
||||||
-e s/sh.*/sh/ )
|
-e s/sh[234].*/sh/ )
|
||||||
|
|
||||||
# Cross compiling and selecting different set of gcc/bin-utils
|
# Cross compiling and selecting different set of gcc/bin-utils
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -210,6 +210,11 @@ ifeq ($(ARCH),sparc64)
|
||||||
SRCARCH := sparc
|
SRCARCH := sparc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Additional ARCH settings for sh
|
||||||
|
ifeq ($(ARCH),sh64)
|
||||||
|
SRCARCH := sh
|
||||||
|
endif
|
||||||
|
|
||||||
# Where to locate arch specific headers
|
# Where to locate arch specific headers
|
||||||
hdr-arch := $(SRCARCH)
|
hdr-arch := $(SRCARCH)
|
||||||
|
|
||||||
|
@ -567,7 +572,7 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
|
||||||
# disable pointer signed / unsigned warnings in gcc 4.0
|
# disable pointer signed / unsigned warnings in gcc 4.0
|
||||||
KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
|
KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
|
||||||
|
|
||||||
# disable invalid "can't wrap" optimzations for signed / pointers
|
# disable invalid "can't wrap" optimizations for signed / pointers
|
||||||
KBUILD_CFLAGS += $(call cc-option,-fwrapv)
|
KBUILD_CFLAGS += $(call cc-option,-fwrapv)
|
||||||
|
|
||||||
# revert to pre-gcc-4.4 behaviour of .eh_frame
|
# revert to pre-gcc-4.4 behaviour of .eh_frame
|
||||||
|
@ -597,6 +602,10 @@ LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
|
||||||
LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
|
LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
|
||||||
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
|
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
|
||||||
|
LDFLAGS_vmlinux += -X
|
||||||
|
endif
|
||||||
|
|
||||||
# Default kernel image to build when no specific target is given.
|
# Default kernel image to build when no specific target is given.
|
||||||
# KBUILD_IMAGE may be overruled on the command line or
|
# KBUILD_IMAGE may be overruled on the command line or
|
||||||
# set in the environment
|
# set in the environment
|
||||||
|
@ -1587,5 +1596,5 @@ PHONY += FORCE
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
# Declare the contents of the .PHONY variable as phony. We keep that
|
# Declare the contents of the .PHONY variable as phony. We keep that
|
||||||
# information in a variable se we can use it in if_changed and friends.
|
# information in a variable so we can use it in if_changed and friends.
|
||||||
.PHONY: $(PHONY)
|
.PHONY: $(PHONY)
|
||||||
|
|
|
@ -109,3 +109,6 @@ config HAVE_CLK
|
||||||
|
|
||||||
config HAVE_DMA_API_DEBUG
|
config HAVE_DMA_API_DEBUG
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
config HAVE_DEFAULT_NO_SPIN_MUTEXES
|
||||||
|
bool
|
||||||
|
|
|
@ -1183,7 +1183,11 @@ CONFIG_RTC_INTF_DEV=y
|
||||||
CONFIG_RTC_DRV_SA1100=y
|
CONFIG_RTC_DRV_SA1100=y
|
||||||
# CONFIG_RTC_DRV_PXA is not set
|
# CONFIG_RTC_DRV_PXA is not set
|
||||||
# CONFIG_DMADEVICES is not set
|
# CONFIG_DMADEVICES is not set
|
||||||
# CONFIG_REGULATOR is not set
|
CONFIG_REGULATOR=y
|
||||||
|
# CONFIG_REGULATOR_DEBUG is not set
|
||||||
|
# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
|
||||||
|
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
|
||||||
|
CONFIG_REGULATOR_BQ24022=y
|
||||||
# CONFIG_UIO is not set
|
# CONFIG_UIO is not set
|
||||||
# CONFIG_STAGING is not set
|
# CONFIG_STAGING is not set
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#define SZ_4K 0x00001000
|
#define SZ_4K 0x00001000
|
||||||
#define SZ_8K 0x00002000
|
#define SZ_8K 0x00002000
|
||||||
#define SZ_16K 0x00004000
|
#define SZ_16K 0x00004000
|
||||||
|
#define SZ_32K 0x00008000
|
||||||
#define SZ_64K 0x00010000
|
#define SZ_64K 0x00010000
|
||||||
#define SZ_128K 0x00020000
|
#define SZ_128K 0x00020000
|
||||||
#define SZ_256K 0x00040000
|
#define SZ_256K 0x00040000
|
||||||
|
|
|
@ -87,7 +87,7 @@ extern void __init at91_add_device_eth(struct at91_eth_data *data);
|
||||||
/* USB Host */
|
/* USB Host */
|
||||||
struct at91_usbh_data {
|
struct at91_usbh_data {
|
||||||
u8 ports; /* number of ports on root hub */
|
u8 ports; /* number of ports on root hub */
|
||||||
u8 vbus_pin[]; /* port power-control pin */
|
u8 vbus_pin[2]; /* port power-control pin */
|
||||||
};
|
};
|
||||||
extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
|
extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
|
||||||
|
|
||||||
|
|
|
@ -590,27 +590,28 @@ static void omap1_init_ext_clk(struct clk * clk)
|
||||||
static int omap1_clk_enable(struct clk *clk)
|
static int omap1_clk_enable(struct clk *clk)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (clk->usecount++ == 0) {
|
|
||||||
if (likely(clk->parent)) {
|
|
||||||
ret = omap1_clk_enable(clk->parent);
|
|
||||||
|
|
||||||
if (unlikely(ret != 0)) {
|
if (clk->usecount++ == 0) {
|
||||||
clk->usecount--;
|
if (clk->parent) {
|
||||||
return ret;
|
ret = omap1_clk_enable(clk->parent);
|
||||||
}
|
if (ret)
|
||||||
|
goto err;
|
||||||
|
|
||||||
if (clk->flags & CLOCK_NO_IDLE_PARENT)
|
if (clk->flags & CLOCK_NO_IDLE_PARENT)
|
||||||
omap1_clk_deny_idle(clk->parent);
|
omap1_clk_deny_idle(clk->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = clk->ops->enable(clk);
|
ret = clk->ops->enable(clk);
|
||||||
|
if (ret) {
|
||||||
if (unlikely(ret != 0) && clk->parent) {
|
if (clk->parent)
|
||||||
omap1_clk_disable(clk->parent);
|
omap1_clk_disable(clk->parent);
|
||||||
clk->usecount--;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
err:
|
||||||
|
clk->usecount--;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,14 +131,14 @@ static struct musb_hdrc_platform_data musb_plat = {
|
||||||
.power = 50, /* up to 100 mA */
|
.power = 50, /* up to 100 mA */
|
||||||
};
|
};
|
||||||
|
|
||||||
static u64 musb_dmamask = DMA_32BIT_MASK;
|
static u64 musb_dmamask = DMA_BIT_MASK(32);
|
||||||
|
|
||||||
static struct platform_device musb_device = {
|
static struct platform_device musb_device = {
|
||||||
.name = "musb_hdrc",
|
.name = "musb_hdrc",
|
||||||
.id = -1,
|
.id = -1,
|
||||||
.dev = {
|
.dev = {
|
||||||
.dma_mask = &musb_dmamask,
|
.dma_mask = &musb_dmamask,
|
||||||
.coherent_dma_mask = DMA_32BIT_MASK,
|
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||||
.platform_data = &musb_plat,
|
.platform_data = &musb_plat,
|
||||||
},
|
},
|
||||||
.num_resources = ARRAY_SIZE(musb_resources),
|
.num_resources = ARRAY_SIZE(musb_resources),
|
||||||
|
@ -146,14 +146,14 @@ static struct platform_device musb_device = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_NOP_USB_XCEIV
|
#ifdef CONFIG_NOP_USB_XCEIV
|
||||||
static u64 nop_xceiv_dmamask = DMA_32BIT_MASK;
|
static u64 nop_xceiv_dmamask = DMA_BIT_MASK(32);
|
||||||
|
|
||||||
static struct platform_device nop_xceiv_device = {
|
static struct platform_device nop_xceiv_device = {
|
||||||
.name = "nop_usb_xceiv",
|
.name = "nop_usb_xceiv",
|
||||||
.id = -1,
|
.id = -1,
|
||||||
.dev = {
|
.dev = {
|
||||||
.dma_mask = &nop_xceiv_dmamask,
|
.dma_mask = &nop_xceiv_dmamask,
|
||||||
.coherent_dma_mask = DMA_32BIT_MASK,
|
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||||
.platform_data = NULL,
|
.platform_data = NULL,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -343,6 +343,15 @@ config ARCH_PXA_PALM
|
||||||
bool "PXA based Palm PDAs"
|
bool "PXA based Palm PDAs"
|
||||||
select HAVE_PWM
|
select HAVE_PWM
|
||||||
|
|
||||||
|
config MACH_PALMTE2
|
||||||
|
bool "Palm Tungsten|E2"
|
||||||
|
default y
|
||||||
|
depends on ARCH_PXA_PALM
|
||||||
|
select PXA25x
|
||||||
|
help
|
||||||
|
Say Y here if you intend to run this kernel on a Palm Tungsten|E2
|
||||||
|
handheld computer.
|
||||||
|
|
||||||
config MACH_PALMT5
|
config MACH_PALMT5
|
||||||
bool "Palm Tungsten|T5"
|
bool "Palm Tungsten|T5"
|
||||||
default y
|
default y
|
||||||
|
|
|
@ -57,6 +57,7 @@ obj-$(CONFIG_MACH_E740) += e740.o
|
||||||
obj-$(CONFIG_MACH_E750) += e750.o
|
obj-$(CONFIG_MACH_E750) += e750.o
|
||||||
obj-$(CONFIG_MACH_E400) += e400.o
|
obj-$(CONFIG_MACH_E400) += e400.o
|
||||||
obj-$(CONFIG_MACH_E800) += e800.o
|
obj-$(CONFIG_MACH_E800) += e800.o
|
||||||
|
obj-$(CONFIG_MACH_PALMTE2) += palmte2.o
|
||||||
obj-$(CONFIG_MACH_PALMT5) += palmt5.o
|
obj-$(CONFIG_MACH_PALMT5) += palmt5.o
|
||||||
obj-$(CONFIG_MACH_PALMTX) += palmtx.o
|
obj-$(CONFIG_MACH_PALMTX) += palmtx.o
|
||||||
obj-$(CONFIG_MACH_PALMLD) += palmld.o
|
obj-$(CONFIG_MACH_PALMLD) += palmld.o
|
||||||
|
|
|
@ -121,7 +121,7 @@ static inline void cmx2xx_init_dm9000(void) {}
|
||||||
/* UCB1400 touchscreen controller */
|
/* UCB1400 touchscreen controller */
|
||||||
#if defined(CONFIG_TOUCHSCREEN_UCB1400) || defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
|
#if defined(CONFIG_TOUCHSCREEN_UCB1400) || defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
|
||||||
static struct platform_device cmx2xx_ts_device = {
|
static struct platform_device cmx2xx_ts_device = {
|
||||||
.name = "ucb1400_ts",
|
.name = "ucb1400_core",
|
||||||
.id = -1,
|
.id = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <net/ax88796.h>
|
#include <linux/interrupt.h>
|
||||||
|
|
||||||
#include <asm/mach-types.h>
|
#include <asm/mach-types.h>
|
||||||
#include <asm/sizes.h>
|
#include <asm/sizes.h>
|
||||||
|
@ -32,12 +32,13 @@
|
||||||
|
|
||||||
#if defined(CONFIG_AX88796)
|
#if defined(CONFIG_AX88796)
|
||||||
#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO)
|
#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Asix AX88796 Ethernet
|
* Asix AX88796 Ethernet
|
||||||
*/
|
*/
|
||||||
static struct ax_plat_data colibri_asix_platdata = {
|
static struct ax_plat_data colibri_asix_platdata = {
|
||||||
.flags = AXFLG_MAC_FROMDEV,
|
.flags = 0, /* defined later */
|
||||||
.wordlength = 2
|
.wordlength = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct resource colibri_asix_resource[] = {
|
static struct resource colibri_asix_resource[] = {
|
||||||
|
@ -49,7 +50,7 @@ static struct resource colibri_asix_resource[] = {
|
||||||
[1] = {
|
[1] = {
|
||||||
.start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
.start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
||||||
.end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
.end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
||||||
.flags = IORESOURCE_IRQ
|
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -70,8 +71,8 @@ static mfp_cfg_t colibri_pxa300_eth_pin_config[] __initdata = {
|
||||||
|
|
||||||
static void __init colibri_pxa300_init_eth(void)
|
static void __init colibri_pxa300_init_eth(void)
|
||||||
{
|
{
|
||||||
|
colibri_pxa3xx_init_eth(&colibri_asix_platdata);
|
||||||
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_eth_pin_config));
|
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_eth_pin_config));
|
||||||
set_irq_type(gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), IRQ_TYPE_EDGE_FALLING);
|
|
||||||
platform_device_register(&asix_device);
|
platform_device_register(&asix_device);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <net/ax88796.h>
|
#include <linux/interrupt.h>
|
||||||
|
|
||||||
#include <asm/mach-types.h>
|
#include <asm/mach-types.h>
|
||||||
#include <asm/sizes.h>
|
#include <asm/sizes.h>
|
||||||
|
@ -38,8 +38,8 @@
|
||||||
* Asix AX88796 Ethernet
|
* Asix AX88796 Ethernet
|
||||||
*/
|
*/
|
||||||
static struct ax_plat_data colibri_asix_platdata = {
|
static struct ax_plat_data colibri_asix_platdata = {
|
||||||
.flags = AXFLG_MAC_FROMDEV,
|
.flags = 0, /* defined later */
|
||||||
.wordlength = 2
|
.wordlength = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct resource colibri_asix_resource[] = {
|
static struct resource colibri_asix_resource[] = {
|
||||||
|
@ -51,7 +51,7 @@ static struct resource colibri_asix_resource[] = {
|
||||||
[1] = {
|
[1] = {
|
||||||
.start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
.start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
||||||
.end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
.end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
||||||
.flags = IORESOURCE_IRQ
|
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,8 +72,8 @@ static mfp_cfg_t colibri_pxa320_eth_pin_config[] __initdata = {
|
||||||
|
|
||||||
static void __init colibri_pxa320_init_eth(void)
|
static void __init colibri_pxa320_init_eth(void)
|
||||||
{
|
{
|
||||||
|
colibri_pxa3xx_init_eth(&colibri_asix_platdata);
|
||||||
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_eth_pin_config));
|
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_eth_pin_config));
|
||||||
set_irq_type(gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), IRQ_TYPE_EDGE_FALLING);
|
|
||||||
platform_device_register(&asix_device);
|
platform_device_register(&asix_device);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
|
#include <linux/etherdevice.h>
|
||||||
#include <asm/mach-types.h>
|
#include <asm/mach-types.h>
|
||||||
#include <mach/hardware.h>
|
#include <mach/hardware.h>
|
||||||
#include <asm/sizes.h>
|
#include <asm/sizes.h>
|
||||||
|
@ -28,6 +29,40 @@
|
||||||
#include "generic.h"
|
#include "generic.h"
|
||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
|
|
||||||
|
#if defined(CONFIG_AX88796)
|
||||||
|
#define ETHER_ADDR_LEN 6
|
||||||
|
static u8 ether_mac_addr[ETHER_ADDR_LEN];
|
||||||
|
|
||||||
|
void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
u64 serial = ((u64) system_serial_high << 32) | system_serial_low;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the bootloader passed in a serial boot tag, which contains a
|
||||||
|
* valid ethernet MAC, pass it to the interface. Toradex ships the
|
||||||
|
* modules with their own bootloader which provides a valid MAC
|
||||||
|
* this way.
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (i = 0; i < ETHER_ADDR_LEN; i++) {
|
||||||
|
ether_mac_addr[i] = serial & 0xff;
|
||||||
|
serial >>= 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_valid_ether_addr(ether_mac_addr)) {
|
||||||
|
plat_data->flags |= AXFLG_MAC_FROMPLATFORM;
|
||||||
|
plat_data->mac_addr = ether_mac_addr;
|
||||||
|
printk(KERN_INFO "%s(): taking MAC from serial boot tag\n",
|
||||||
|
__func__);
|
||||||
|
} else {
|
||||||
|
plat_data->flags |= AXFLG_MAC_FROMDEV;
|
||||||
|
printk(KERN_INFO "%s(): no valid serial boot tag found, "
|
||||||
|
"taking MAC from device\n", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
|
#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
|
||||||
static int mmc_detect_pin;
|
static int mmc_detect_pin;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <linux/leds.h>
|
#include <linux/leds.h>
|
||||||
|
|
||||||
|
#include <asm/mach-types.h>
|
||||||
|
|
||||||
static struct gpio_keys_button csb701_buttons[] = {
|
static struct gpio_keys_button csb701_buttons[] = {
|
||||||
{
|
{
|
||||||
.code = 0x7,
|
.code = 0x7,
|
||||||
|
@ -54,6 +56,9 @@ static struct platform_device *devices[] __initdata = {
|
||||||
|
|
||||||
static int __init csb701_init(void)
|
static int __init csb701_init(void)
|
||||||
{
|
{
|
||||||
|
if (!machine_is_csb726())
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
return platform_add_devices(devices, ARRAY_SIZE(devices));
|
return platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <mach/udc.h>
|
#include <mach/udc.h>
|
||||||
#include <mach/irda.h>
|
#include <mach/irda.h>
|
||||||
#include <mach/irqs.h>
|
#include <mach/irqs.h>
|
||||||
|
#include <mach/audio.h>
|
||||||
|
|
||||||
#include "generic.h"
|
#include "generic.h"
|
||||||
#include "eseries.h"
|
#include "eseries.h"
|
||||||
|
@ -197,6 +198,7 @@ static void __init e740_init(void)
|
||||||
eseries_get_tmio_gpios();
|
eseries_get_tmio_gpios();
|
||||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||||
pxa_set_udc_info(&e7xx_udc_mach_info);
|
pxa_set_udc_info(&e7xx_udc_mach_info);
|
||||||
|
pxa_set_ac97_info(NULL);
|
||||||
e7xx_irda_init();
|
e7xx_irda_init();
|
||||||
pxa_set_ficp_info(&e7xx_ficp_platform_data);
|
pxa_set_ficp_info(&e7xx_ficp_platform_data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <mach/udc.h>
|
#include <mach/udc.h>
|
||||||
#include <mach/irda.h>
|
#include <mach/irda.h>
|
||||||
#include <mach/irqs.h>
|
#include <mach/irqs.h>
|
||||||
|
#include <mach/audio.h>
|
||||||
|
|
||||||
#include "generic.h"
|
#include "generic.h"
|
||||||
#include "eseries.h"
|
#include "eseries.h"
|
||||||
|
@ -198,6 +199,7 @@ static void __init e750_init(void)
|
||||||
eseries_get_tmio_gpios();
|
eseries_get_tmio_gpios();
|
||||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||||
pxa_set_udc_info(&e7xx_udc_mach_info);
|
pxa_set_udc_info(&e7xx_udc_mach_info);
|
||||||
|
pxa_set_ac97_info(NULL);
|
||||||
e7xx_irda_init();
|
e7xx_irda_init();
|
||||||
pxa_set_ficp_info(&e7xx_ficp_platform_data);
|
pxa_set_ficp_info(&e7xx_ficp_platform_data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <mach/eseries-gpio.h>
|
#include <mach/eseries-gpio.h>
|
||||||
#include <mach/udc.h>
|
#include <mach/udc.h>
|
||||||
#include <mach/irqs.h>
|
#include <mach/irqs.h>
|
||||||
|
#include <mach/audio.h>
|
||||||
|
|
||||||
#include "generic.h"
|
#include "generic.h"
|
||||||
#include "eseries.h"
|
#include "eseries.h"
|
||||||
|
@ -199,6 +200,7 @@ static void __init e800_init(void)
|
||||||
eseries_get_tmio_gpios();
|
eseries_get_tmio_gpios();
|
||||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||||
pxa_set_udc_info(&e800_udc_mach_info);
|
pxa_set_udc_info(&e800_udc_mach_info);
|
||||||
|
pxa_set_ac97_info(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
MACHINE_START(E800, "Toshiba e800")
|
MACHINE_START(E800, "Toshiba e800")
|
||||||
|
|
|
@ -25,8 +25,10 @@
|
||||||
#include <linux/regulator/machine.h>
|
#include <linux/regulator/machine.h>
|
||||||
#include <linux/spi/spi.h>
|
#include <linux/spi/spi.h>
|
||||||
#include <linux/spi/tdo24m.h>
|
#include <linux/spi/tdo24m.h>
|
||||||
|
#include <linux/spi/libertas_spi.h>
|
||||||
#include <linux/power_supply.h>
|
#include <linux/power_supply.h>
|
||||||
#include <linux/apm-emulation.h>
|
#include <linux/apm-emulation.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
|
|
||||||
#include <media/soc_camera.h>
|
#include <media/soc_camera.h>
|
||||||
|
|
||||||
|
@ -62,6 +64,8 @@
|
||||||
#define GPIO93_CAM_RESET (93)
|
#define GPIO93_CAM_RESET (93)
|
||||||
#define GPIO41_ETHIRQ (41)
|
#define GPIO41_ETHIRQ (41)
|
||||||
#define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ)
|
#define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ)
|
||||||
|
#define GPIO115_WLAN_PWEN (115)
|
||||||
|
#define GPIO19_WLAN_STRAP (19)
|
||||||
|
|
||||||
static int mmc_cd;
|
static int mmc_cd;
|
||||||
static int nand_rb;
|
static int nand_rb;
|
||||||
|
@ -159,8 +163,8 @@ static unsigned long common_pin_config[] = {
|
||||||
GPIO57_SSP1_TXD,
|
GPIO57_SSP1_TXD,
|
||||||
|
|
||||||
/* SSP2 */
|
/* SSP2 */
|
||||||
GPIO19_SSP2_SCLK,
|
GPIO19_GPIO, /* SSP2 clock is used as GPIO for Libertas pin-strap */
|
||||||
GPIO14_SSP2_SFRM,
|
GPIO14_GPIO,
|
||||||
GPIO89_SSP2_TXD,
|
GPIO89_SSP2_TXD,
|
||||||
GPIO88_SSP2_RXD,
|
GPIO88_SSP2_RXD,
|
||||||
|
|
||||||
|
@ -648,20 +652,86 @@ static struct tdo24m_platform_data em_x270_tdo24m_pdata = {
|
||||||
.model = TDO35S,
|
.model = TDO35S,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct pxa2xx_spi_master em_x270_spi_2_info = {
|
||||||
|
.num_chipselect = 1,
|
||||||
|
.enable_dma = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct pxa2xx_spi_chip em_x270_libertas_chip = {
|
||||||
|
.rx_threshold = 1,
|
||||||
|
.tx_threshold = 1,
|
||||||
|
.timeout = 1000,
|
||||||
|
};
|
||||||
|
|
||||||
|
static unsigned long em_x270_libertas_pin_config[] = {
|
||||||
|
/* SSP2 */
|
||||||
|
GPIO19_SSP2_SCLK,
|
||||||
|
GPIO14_GPIO,
|
||||||
|
GPIO89_SSP2_TXD,
|
||||||
|
GPIO88_SSP2_RXD,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int em_x270_libertas_setup(struct spi_device *spi)
|
||||||
|
{
|
||||||
|
int err = gpio_request(GPIO115_WLAN_PWEN, "WLAN PWEN");
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
gpio_direction_output(GPIO19_WLAN_STRAP, 1);
|
||||||
|
mdelay(100);
|
||||||
|
|
||||||
|
pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_libertas_pin_config));
|
||||||
|
|
||||||
|
gpio_direction_output(GPIO115_WLAN_PWEN, 0);
|
||||||
|
mdelay(100);
|
||||||
|
gpio_set_value(GPIO115_WLAN_PWEN, 1);
|
||||||
|
mdelay(100);
|
||||||
|
|
||||||
|
spi->bits_per_word = 16;
|
||||||
|
spi_setup(spi);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int em_x270_libertas_teardown(struct spi_device *spi)
|
||||||
|
{
|
||||||
|
gpio_set_value(GPIO115_WLAN_PWEN, 0);
|
||||||
|
gpio_free(GPIO115_WLAN_PWEN);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct libertas_spi_platform_data em_x270_libertas_pdata = {
|
||||||
|
.use_dummy_writes = 1,
|
||||||
|
.gpio_cs = 14,
|
||||||
|
.setup = em_x270_libertas_setup,
|
||||||
|
.teardown = em_x270_libertas_teardown,
|
||||||
|
};
|
||||||
|
|
||||||
static struct spi_board_info em_x270_spi_devices[] __initdata = {
|
static struct spi_board_info em_x270_spi_devices[] __initdata = {
|
||||||
{
|
{
|
||||||
.modalias = "tdo24m",
|
.modalias = "tdo24m",
|
||||||
.max_speed_hz = 1000000,
|
.max_speed_hz = 1000000,
|
||||||
.bus_num = 1,
|
.bus_num = 1,
|
||||||
.chip_select = 0,
|
.chip_select = 0,
|
||||||
.controller_data = &em_x270_tdo24m_chip,
|
.controller_data = &em_x270_tdo24m_chip,
|
||||||
.platform_data = &em_x270_tdo24m_pdata,
|
.platform_data = &em_x270_tdo24m_pdata,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.modalias = "libertas_spi",
|
||||||
|
.max_speed_hz = 13000000,
|
||||||
|
.bus_num = 2,
|
||||||
|
.irq = IRQ_GPIO(116),
|
||||||
|
.chip_select = 0,
|
||||||
|
.controller_data = &em_x270_libertas_chip,
|
||||||
|
.platform_data = &em_x270_libertas_pdata,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void __init em_x270_init_spi(void)
|
static void __init em_x270_init_spi(void)
|
||||||
{
|
{
|
||||||
pxa2xx_set_spi_info(1, &em_x270_spi_info);
|
pxa2xx_set_spi_info(1, &em_x270_spi_info);
|
||||||
|
pxa2xx_set_spi_info(2, &em_x270_spi_2_info);
|
||||||
spi_register_board_info(ARRAY_AND_SIZE(em_x270_spi_devices));
|
spi_register_board_info(ARRAY_AND_SIZE(em_x270_spi_devices));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#ifndef _COLIBRI_H_
|
#ifndef _COLIBRI_H_
|
||||||
#define _COLIBRI_H_
|
#define _COLIBRI_H_
|
||||||
|
|
||||||
|
#include <net/ax88796.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* common settings for all modules
|
* common settings for all modules
|
||||||
*/
|
*/
|
||||||
|
@ -16,6 +19,10 @@ extern void colibri_pxa3xx_init_lcd(int bl_pin);
|
||||||
static inline void colibri_pxa3xx_init_lcd(int) {}
|
static inline void colibri_pxa3xx_init_lcd(int) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_AX88796)
|
||||||
|
extern void colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* physical memory regions */
|
/* physical memory regions */
|
||||||
#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
|
#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#define GPIO22_MAGICIAN_VIBRA_EN 22
|
#define GPIO22_MAGICIAN_VIBRA_EN 22
|
||||||
#define GPIO26_MAGICIAN_GSM_POWER 26
|
#define GPIO26_MAGICIAN_GSM_POWER 26
|
||||||
#define GPIO27_MAGICIAN_USBC_PUEN 27
|
#define GPIO27_MAGICIAN_USBC_PUEN 27
|
||||||
#define GPIO30_MAGICIAN_nCHARGE_EN 30
|
#define GPIO30_MAGICIAN_BQ24022_nCHARGE_EN 30
|
||||||
#define GPIO37_MAGICIAN_KEY_HANGUP 37
|
#define GPIO37_MAGICIAN_KEY_HANGUP 37
|
||||||
#define GPIO38_MAGICIAN_KEY_CONTACTS 38
|
#define GPIO38_MAGICIAN_KEY_CONTACTS 38
|
||||||
#define GPIO40_MAGICIAN_GSM_OUT2 40
|
#define GPIO40_MAGICIAN_GSM_OUT2 40
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
#define EGPIO_MAGICIAN_UNKNOWN_WAVEDEV_DLL MAGICIAN_EGPIO(2, 2)
|
#define EGPIO_MAGICIAN_UNKNOWN_WAVEDEV_DLL MAGICIAN_EGPIO(2, 2)
|
||||||
#define EGPIO_MAGICIAN_FLASH_VPP MAGICIAN_EGPIO(2, 3)
|
#define EGPIO_MAGICIAN_FLASH_VPP MAGICIAN_EGPIO(2, 3)
|
||||||
#define EGPIO_MAGICIAN_BL_POWER2 MAGICIAN_EGPIO(2, 4)
|
#define EGPIO_MAGICIAN_BL_POWER2 MAGICIAN_EGPIO(2, 4)
|
||||||
#define EGPIO_MAGICIAN_CHARGE_EN MAGICIAN_EGPIO(2, 5)
|
#define EGPIO_MAGICIAN_BQ24022_ISET2 MAGICIAN_EGPIO(2, 5)
|
||||||
#define EGPIO_MAGICIAN_GSM_POWER MAGICIAN_EGPIO(2, 7)
|
#define EGPIO_MAGICIAN_GSM_POWER MAGICIAN_EGPIO(2, 7)
|
||||||
|
|
||||||
/* input */
|
/* input */
|
||||||
|
|
|
@ -87,6 +87,7 @@
|
||||||
#define PALMLD_IDE_SIZE 0x00100000
|
#define PALMLD_IDE_SIZE 0x00100000
|
||||||
|
|
||||||
#define PALMLD_PHYS_IO_START 0x40000000
|
#define PALMLD_PHYS_IO_START 0x40000000
|
||||||
|
#define PALMLD_STR_BASE 0xa0200000
|
||||||
|
|
||||||
/* BATTERY */
|
/* BATTERY */
|
||||||
#define PALMLD_BAT_MAX_VOLTAGE 4000 /* 4.00V maximum voltage */
|
#define PALMLD_BAT_MAX_VOLTAGE 4000 /* 4.00V maximum voltage */
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
/* Various addresses */
|
/* Various addresses */
|
||||||
#define PALMT5_PHYS_RAM_START 0xa0000000
|
#define PALMT5_PHYS_RAM_START 0xa0000000
|
||||||
#define PALMT5_PHYS_IO_START 0x40000000
|
#define PALMT5_PHYS_IO_START 0x40000000
|
||||||
|
#define PALMT5_STR_BASE 0xa0200000
|
||||||
|
|
||||||
/* TOUCHSCREEN */
|
/* TOUCHSCREEN */
|
||||||
#define AC97_LINK_FRAME 21
|
#define AC97_LINK_FRAME 21
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
/*
|
||||||
|
* GPIOs and interrupts for Palm Tungsten|E2 Handheld Computer
|
||||||
|
*
|
||||||
|
* Author:
|
||||||
|
* Carlos Eduardo Medaglia Dyonisio <cadu@nerdfeliz.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _INCLUDE_PALMTE2_H_
|
||||||
|
#define _INCLUDE_PALMTE2_H_
|
||||||
|
|
||||||
|
/** HERE ARE GPIOs **/
|
||||||
|
|
||||||
|
/* GPIOs */
|
||||||
|
#define GPIO_NR_PALMTE2_POWER_DETECT 9
|
||||||
|
#define GPIO_NR_PALMTE2_HOTSYNC_BUTTON_N 4
|
||||||
|
#define GPIO_NR_PALMTE2_EARPHONE_DETECT 15
|
||||||
|
|
||||||
|
/* SD/MMC */
|
||||||
|
#define GPIO_NR_PALMTE2_SD_DETECT_N 10
|
||||||
|
#define GPIO_NR_PALMTE2_SD_POWER 55
|
||||||
|
#define GPIO_NR_PALMTE2_SD_READONLY 51
|
||||||
|
|
||||||
|
/* IRDA - disable GPIO connected to SD pin of tranceiver (TFBS4710?) ? */
|
||||||
|
#define GPIO_NR_PALMTE2_IR_DISABLE 48
|
||||||
|
|
||||||
|
/* USB */
|
||||||
|
#define GPIO_NR_PALMTE2_USB_DETECT_N 35
|
||||||
|
#define GPIO_NR_PALMTE2_USB_PULLUP 53
|
||||||
|
|
||||||
|
/* LCD/BACKLIGHT */
|
||||||
|
#define GPIO_NR_PALMTE2_BL_POWER 56
|
||||||
|
#define GPIO_NR_PALMTE2_LCD_POWER 37
|
||||||
|
|
||||||
|
/* KEYS */
|
||||||
|
#define GPIO_NR_PALMTE2_KEY_NOTES 5
|
||||||
|
#define GPIO_NR_PALMTE2_KEY_TASKS 7
|
||||||
|
#define GPIO_NR_PALMTE2_KEY_CALENDAR 11
|
||||||
|
#define GPIO_NR_PALMTE2_KEY_CONTACTS 13
|
||||||
|
#define GPIO_NR_PALMTE2_KEY_CENTER 14
|
||||||
|
#define GPIO_NR_PALMTE2_KEY_LEFT 19
|
||||||
|
#define GPIO_NR_PALMTE2_KEY_RIGHT 20
|
||||||
|
#define GPIO_NR_PALMTE2_KEY_DOWN 21
|
||||||
|
#define GPIO_NR_PALMTE2_KEY_UP 22
|
||||||
|
|
||||||
|
/** HERE ARE INIT VALUES **/
|
||||||
|
|
||||||
|
/* BACKLIGHT */
|
||||||
|
#define PALMTE2_MAX_INTENSITY 0xFE
|
||||||
|
#define PALMTE2_DEFAULT_INTENSITY 0x7E
|
||||||
|
#define PALMTE2_LIMIT_MASK 0x7F
|
||||||
|
#define PALMTE2_PRESCALER 0x3F
|
||||||
|
#define PALMTE2_PERIOD_NS 3500
|
||||||
|
|
||||||
|
/* BATTERY */
|
||||||
|
#define PALMTE2_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */
|
||||||
|
#define PALMTE2_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */
|
||||||
|
#define PALMTE2_BAT_MAX_CURRENT 0 /* unknokn */
|
||||||
|
#define PALMTE2_BAT_MIN_CURRENT 0 /* unknown */
|
||||||
|
#define PALMTE2_BAT_MAX_CHARGE 1 /* unknown */
|
||||||
|
#define PALMTE2_BAT_MIN_CHARGE 1 /* unknown */
|
||||||
|
#define PALMTE2_MAX_LIFE_MINS 360 /* on-life in minutes */
|
||||||
|
|
||||||
|
#endif
|
|
@ -78,6 +78,8 @@
|
||||||
#define PALMTX_PHYS_RAM_START 0xa0000000
|
#define PALMTX_PHYS_RAM_START 0xa0000000
|
||||||
#define PALMTX_PHYS_IO_START 0x40000000
|
#define PALMTX_PHYS_IO_START 0x40000000
|
||||||
|
|
||||||
|
#define PALMTX_STR_BASE 0xa0200000
|
||||||
|
|
||||||
#define PALMTX_PHYS_FLASH_START PXA_CS0_PHYS /* ChipSelect 0 */
|
#define PALMTX_PHYS_FLASH_START PXA_CS0_PHYS /* ChipSelect 0 */
|
||||||
#define PALMTX_PHYS_NAND_START PXA_CS1_PHYS /* ChipSelect 1 */
|
#define PALMTX_PHYS_NAND_START PXA_CS1_PHYS /* ChipSelect 1 */
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include <linux/mtd/physmap.h>
|
#include <linux/mtd/physmap.h>
|
||||||
#include <linux/pda_power.h>
|
#include <linux/pda_power.h>
|
||||||
#include <linux/pwm_backlight.h>
|
#include <linux/pwm_backlight.h>
|
||||||
|
#include <linux/regulator/bq24022.h>
|
||||||
|
#include <linux/regulator/machine.h>
|
||||||
#include <linux/usb/gpio_vbus.h>
|
#include <linux/usb/gpio_vbus.h>
|
||||||
|
|
||||||
#include <mach/hardware.h>
|
#include <mach/hardware.h>
|
||||||
|
@ -552,33 +554,7 @@ static struct platform_device gpio_vbus = {
|
||||||
|
|
||||||
static int power_supply_init(struct device *dev)
|
static int power_supply_init(struct device *dev)
|
||||||
{
|
{
|
||||||
int ret;
|
return gpio_request(EGPIO_MAGICIAN_CABLE_STATE_AC, "CABLE_STATE_AC");
|
||||||
|
|
||||||
ret = gpio_request(EGPIO_MAGICIAN_CABLE_STATE_AC, "CABLE_STATE_AC");
|
|
||||||
if (ret)
|
|
||||||
goto err_cs_ac;
|
|
||||||
ret = gpio_request(EGPIO_MAGICIAN_CABLE_STATE_USB, "CABLE_STATE_USB");
|
|
||||||
if (ret)
|
|
||||||
goto err_cs_usb;
|
|
||||||
ret = gpio_request(EGPIO_MAGICIAN_CHARGE_EN, "CHARGE_EN");
|
|
||||||
if (ret)
|
|
||||||
goto err_chg_en;
|
|
||||||
ret = gpio_request(GPIO30_MAGICIAN_nCHARGE_EN, "nCHARGE_EN");
|
|
||||||
if (!ret)
|
|
||||||
ret = gpio_direction_output(GPIO30_MAGICIAN_nCHARGE_EN, 0);
|
|
||||||
if (ret)
|
|
||||||
goto err_nchg_en;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
err_nchg_en:
|
|
||||||
gpio_free(EGPIO_MAGICIAN_CHARGE_EN);
|
|
||||||
err_chg_en:
|
|
||||||
gpio_free(EGPIO_MAGICIAN_CABLE_STATE_USB);
|
|
||||||
err_cs_usb:
|
|
||||||
gpio_free(EGPIO_MAGICIAN_CABLE_STATE_AC);
|
|
||||||
err_cs_ac:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int magician_is_ac_online(void)
|
static int magician_is_ac_online(void)
|
||||||
|
@ -586,22 +562,8 @@ static int magician_is_ac_online(void)
|
||||||
return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC);
|
return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int magician_is_usb_online(void)
|
|
||||||
{
|
|
||||||
return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_USB);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void magician_set_charge(int flags)
|
|
||||||
{
|
|
||||||
gpio_set_value(GPIO30_MAGICIAN_nCHARGE_EN, !flags);
|
|
||||||
gpio_set_value(EGPIO_MAGICIAN_CHARGE_EN, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void power_supply_exit(struct device *dev)
|
static void power_supply_exit(struct device *dev)
|
||||||
{
|
{
|
||||||
gpio_free(GPIO30_MAGICIAN_nCHARGE_EN);
|
|
||||||
gpio_free(EGPIO_MAGICIAN_CHARGE_EN);
|
|
||||||
gpio_free(EGPIO_MAGICIAN_CABLE_STATE_USB);
|
|
||||||
gpio_free(EGPIO_MAGICIAN_CABLE_STATE_AC);
|
gpio_free(EGPIO_MAGICIAN_CABLE_STATE_AC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,8 +574,6 @@ static char *magician_supplicants[] = {
|
||||||
static struct pda_power_pdata power_supply_info = {
|
static struct pda_power_pdata power_supply_info = {
|
||||||
.init = power_supply_init,
|
.init = power_supply_init,
|
||||||
.is_ac_online = magician_is_ac_online,
|
.is_ac_online = magician_is_ac_online,
|
||||||
.is_usb_online = magician_is_usb_online,
|
|
||||||
.set_charge = magician_set_charge,
|
|
||||||
.exit = power_supply_exit,
|
.exit = power_supply_exit,
|
||||||
.supplied_to = magician_supplicants,
|
.supplied_to = magician_supplicants,
|
||||||
.num_supplicants = ARRAY_SIZE(magician_supplicants),
|
.num_supplicants = ARRAY_SIZE(magician_supplicants),
|
||||||
|
@ -646,6 +606,43 @@ static struct platform_device power_supply = {
|
||||||
.num_resources = ARRAY_SIZE(power_supply_resources),
|
.num_resources = ARRAY_SIZE(power_supply_resources),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Battery charger
|
||||||
|
*/
|
||||||
|
|
||||||
|
static struct regulator_consumer_supply bq24022_consumers[] = {
|
||||||
|
{
|
||||||
|
.dev = &gpio_vbus.dev,
|
||||||
|
.supply = "vbus_draw",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.dev = &power_supply.dev,
|
||||||
|
.supply = "ac_draw",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct regulator_init_data bq24022_init_data = {
|
||||||
|
.constraints = {
|
||||||
|
.max_uA = 500000,
|
||||||
|
.valid_ops_mask = REGULATOR_CHANGE_CURRENT,
|
||||||
|
},
|
||||||
|
.num_consumer_supplies = ARRAY_SIZE(bq24022_consumers),
|
||||||
|
.consumer_supplies = bq24022_consumers,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct bq24022_mach_info bq24022_info = {
|
||||||
|
.gpio_nce = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
|
||||||
|
.gpio_iset2 = EGPIO_MAGICIAN_BQ24022_ISET2,
|
||||||
|
.init_data = &bq24022_init_data,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device bq24022 = {
|
||||||
|
.name = "bq24022",
|
||||||
|
.id = -1,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = &bq24022_info,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MMC/SD
|
* MMC/SD
|
||||||
|
@ -756,6 +753,7 @@ static struct platform_device *devices[] __initdata = {
|
||||||
&egpio,
|
&egpio,
|
||||||
&backlight,
|
&backlight,
|
||||||
&pasic3,
|
&pasic3,
|
||||||
|
&bq24022,
|
||||||
&gpio_vbus,
|
&gpio_vbus,
|
||||||
&power_supply,
|
&power_supply,
|
||||||
&strataflash,
|
&strataflash,
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include <mach/pxa27x-udc.h>
|
#include <mach/pxa27x-udc.h>
|
||||||
#include <mach/i2c.h>
|
#include <mach/i2c.h>
|
||||||
#include <mach/camera.h>
|
#include <mach/camera.h>
|
||||||
|
#include <mach/audio.h>
|
||||||
#include <media/soc_camera.h>
|
#include <media/soc_camera.h>
|
||||||
|
|
||||||
#include <mach/mioa701.h>
|
#include <mach/mioa701.h>
|
||||||
|
@ -763,8 +764,6 @@ MIO_PARENT_DEV(mioa701_backlight, "pwm-backlight", &pxa27x_device_pwm0.dev,
|
||||||
&mioa701_backlight_data);
|
&mioa701_backlight_data);
|
||||||
MIO_SIMPLE_DEV(mioa701_led, "leds-gpio", &gpio_led_info)
|
MIO_SIMPLE_DEV(mioa701_led, "leds-gpio", &gpio_led_info)
|
||||||
MIO_SIMPLE_DEV(pxa2xx_pcm, "pxa2xx-pcm", NULL)
|
MIO_SIMPLE_DEV(pxa2xx_pcm, "pxa2xx-pcm", NULL)
|
||||||
MIO_SIMPLE_DEV(pxa2xx_ac97, "pxa2xx-ac97", NULL)
|
|
||||||
MIO_PARENT_DEV(mio_wm9713_codec, "wm9713-codec", &pxa2xx_ac97.dev, NULL)
|
|
||||||
MIO_SIMPLE_DEV(mioa701_sound, "mioa701-wm9713", NULL)
|
MIO_SIMPLE_DEV(mioa701_sound, "mioa701-wm9713", NULL)
|
||||||
MIO_SIMPLE_DEV(mioa701_board, "mioa701-board", NULL)
|
MIO_SIMPLE_DEV(mioa701_board, "mioa701-board", NULL)
|
||||||
MIO_SIMPLE_DEV(gpio_vbus, "gpio-vbus", &gpio_vbus_data);
|
MIO_SIMPLE_DEV(gpio_vbus, "gpio-vbus", &gpio_vbus_data);
|
||||||
|
@ -774,8 +773,6 @@ static struct platform_device *devices[] __initdata = {
|
||||||
&mioa701_backlight,
|
&mioa701_backlight,
|
||||||
&mioa701_led,
|
&mioa701_led,
|
||||||
&pxa2xx_pcm,
|
&pxa2xx_pcm,
|
||||||
&pxa2xx_ac97,
|
|
||||||
&mio_wm9713_codec,
|
|
||||||
&mioa701_sound,
|
&mioa701_sound,
|
||||||
&power_dev,
|
&power_dev,
|
||||||
&strataflash,
|
&strataflash,
|
||||||
|
@ -818,6 +815,7 @@ static void __init mioa701_machine_init(void)
|
||||||
pxa_set_keypad_info(&mioa701_keypad_info);
|
pxa_set_keypad_info(&mioa701_keypad_info);
|
||||||
wm97xx_bat_set_pdata(&mioa701_battery_data);
|
wm97xx_bat_set_pdata(&mioa701_battery_data);
|
||||||
pxa_set_udc_info(&mioa701_udc_info);
|
pxa_set_udc_info(&mioa701_udc_info);
|
||||||
|
pxa_set_ac97_info(NULL);
|
||||||
pm_power_off = mioa701_poweroff;
|
pm_power_off = mioa701_poweroff;
|
||||||
arm_pm_restart = mioa701_restart;
|
arm_pm_restart = mioa701_restart;
|
||||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <linux/wm97xx_batt.h>
|
#include <linux/wm97xx_batt.h>
|
||||||
#include <linux/power_supply.h>
|
#include <linux/power_supply.h>
|
||||||
|
#include <linux/sysdev.h>
|
||||||
|
|
||||||
#include <asm/mach-types.h>
|
#include <asm/mach-types.h>
|
||||||
#include <asm/mach/arch.h>
|
#include <asm/mach/arch.h>
|
||||||
|
@ -68,10 +69,10 @@ static unsigned long palmld_pin_config[] __initdata = {
|
||||||
GPIO47_FICP_TXD,
|
GPIO47_FICP_TXD,
|
||||||
|
|
||||||
/* MATRIX KEYPAD */
|
/* MATRIX KEYPAD */
|
||||||
GPIO100_KP_MKIN_0,
|
GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO101_KP_MKIN_1,
|
GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO102_KP_MKIN_2,
|
GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO97_KP_MKIN_3,
|
GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO103_KP_MKOUT_0,
|
GPIO103_KP_MKOUT_0,
|
||||||
GPIO104_KP_MKOUT_1,
|
GPIO104_KP_MKOUT_1,
|
||||||
GPIO105_KP_MKOUT_2,
|
GPIO105_KP_MKOUT_2,
|
||||||
|
@ -506,6 +507,33 @@ static struct pxafb_mach_info palmld_lcd_screen = {
|
||||||
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
|
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Power management - standby
|
||||||
|
******************************************************************************/
|
||||||
|
#ifdef CONFIG_PM
|
||||||
|
static u32 *addr __initdata;
|
||||||
|
static u32 resume[3] __initdata = {
|
||||||
|
0xe3a00101, /* mov r0, #0x40000000 */
|
||||||
|
0xe380060f, /* orr r0, r0, #0x00f00000 */
|
||||||
|
0xe590f008, /* ldr pc, [r0, #0x08] */
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __init palmld_pm_init(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* this is where the bootloader jumps */
|
||||||
|
addr = phys_to_virt(PALMLD_STR_BASE);
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++)
|
||||||
|
addr[i] = resume[i];
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
device_initcall(palmld_pm_init);
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Machine init
|
* Machine init
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
|
@ -75,10 +75,10 @@ static unsigned long palmt5_pin_config[] __initdata = {
|
||||||
GPIO95_GPIO, /* usb power */
|
GPIO95_GPIO, /* usb power */
|
||||||
|
|
||||||
/* MATRIX KEYPAD */
|
/* MATRIX KEYPAD */
|
||||||
GPIO100_KP_MKIN_0,
|
GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO101_KP_MKIN_1,
|
GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO102_KP_MKIN_2,
|
GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO97_KP_MKIN_3,
|
GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO103_KP_MKOUT_0,
|
GPIO103_KP_MKOUT_0,
|
||||||
GPIO104_KP_MKOUT_1,
|
GPIO104_KP_MKOUT_1,
|
||||||
GPIO105_KP_MKOUT_2,
|
GPIO105_KP_MKOUT_2,
|
||||||
|
@ -449,6 +449,33 @@ static struct pxafb_mach_info palmt5_lcd_screen = {
|
||||||
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
|
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Power management - standby
|
||||||
|
******************************************************************************/
|
||||||
|
#ifdef CONFIG_PM
|
||||||
|
static u32 *addr __initdata;
|
||||||
|
static u32 resume[3] __initdata = {
|
||||||
|
0xe3a00101, /* mov r0, #0x40000000 */
|
||||||
|
0xe380060f, /* orr r0, r0, #0x00f00000 */
|
||||||
|
0xe590f008, /* ldr pc, [r0, #0x08] */
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __init palmt5_pm_init(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* this is where the bootloader jumps */
|
||||||
|
addr = phys_to_virt(PALMT5_STR_BASE);
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++)
|
||||||
|
addr[i] = resume[i];
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
device_initcall(palmt5_pm_init);
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Machine init
|
* Machine init
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
|
@ -0,0 +1,466 @@
|
||||||
|
/*
|
||||||
|
* Hardware definitions for Palm Tungsten|E2
|
||||||
|
*
|
||||||
|
* Author:
|
||||||
|
* Carlos Eduardo Medaglia Dyonisio <cadu@nerdfeliz.com>
|
||||||
|
*
|
||||||
|
* Rewrite for mainline:
|
||||||
|
* Marek Vasut <marek.vasut@gmail.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* (find more info at www.hackndev.com)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
|
#include <linux/irq.h>
|
||||||
|
#include <linux/gpio_keys.h>
|
||||||
|
#include <linux/input.h>
|
||||||
|
#include <linux/pda_power.h>
|
||||||
|
#include <linux/pwm_backlight.h>
|
||||||
|
#include <linux/gpio.h>
|
||||||
|
#include <linux/wm97xx_batt.h>
|
||||||
|
#include <linux/power_supply.h>
|
||||||
|
|
||||||
|
#include <asm/mach-types.h>
|
||||||
|
#include <asm/mach/arch.h>
|
||||||
|
#include <asm/mach/map.h>
|
||||||
|
|
||||||
|
#include <mach/audio.h>
|
||||||
|
#include <mach/palmte2.h>
|
||||||
|
#include <mach/mmc.h>
|
||||||
|
#include <mach/pxafb.h>
|
||||||
|
#include <mach/mfp-pxa25x.h>
|
||||||
|
#include <mach/irda.h>
|
||||||
|
#include <mach/udc.h>
|
||||||
|
|
||||||
|
#include "generic.h"
|
||||||
|
#include "devices.h"
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Pin configuration
|
||||||
|
******************************************************************************/
|
||||||
|
static unsigned long palmte2_pin_config[] __initdata = {
|
||||||
|
/* MMC */
|
||||||
|
GPIO6_MMC_CLK,
|
||||||
|
GPIO8_MMC_CS0,
|
||||||
|
GPIO10_GPIO, /* SD detect */
|
||||||
|
GPIO55_GPIO, /* SD power */
|
||||||
|
GPIO51_GPIO, /* SD r/o switch */
|
||||||
|
|
||||||
|
/* AC97 */
|
||||||
|
GPIO28_AC97_BITCLK,
|
||||||
|
GPIO29_AC97_SDATA_IN_0,
|
||||||
|
GPIO30_AC97_SDATA_OUT,
|
||||||
|
GPIO31_AC97_SYNC,
|
||||||
|
|
||||||
|
/* PWM */
|
||||||
|
GPIO16_PWM0_OUT,
|
||||||
|
|
||||||
|
/* USB */
|
||||||
|
GPIO15_GPIO, /* usb detect */
|
||||||
|
GPIO53_GPIO, /* usb power */
|
||||||
|
|
||||||
|
/* IrDA */
|
||||||
|
GPIO48_GPIO, /* ir disable */
|
||||||
|
GPIO46_FICP_RXD,
|
||||||
|
GPIO47_FICP_TXD,
|
||||||
|
|
||||||
|
/* LCD */
|
||||||
|
GPIO58_LCD_LDD_0,
|
||||||
|
GPIO59_LCD_LDD_1,
|
||||||
|
GPIO60_LCD_LDD_2,
|
||||||
|
GPIO61_LCD_LDD_3,
|
||||||
|
GPIO62_LCD_LDD_4,
|
||||||
|
GPIO63_LCD_LDD_5,
|
||||||
|
GPIO64_LCD_LDD_6,
|
||||||
|
GPIO65_LCD_LDD_7,
|
||||||
|
GPIO66_LCD_LDD_8,
|
||||||
|
GPIO67_LCD_LDD_9,
|
||||||
|
GPIO68_LCD_LDD_10,
|
||||||
|
GPIO69_LCD_LDD_11,
|
||||||
|
GPIO70_LCD_LDD_12,
|
||||||
|
GPIO71_LCD_LDD_13,
|
||||||
|
GPIO72_LCD_LDD_14,
|
||||||
|
GPIO73_LCD_LDD_15,
|
||||||
|
GPIO74_LCD_FCLK,
|
||||||
|
GPIO75_LCD_LCLK,
|
||||||
|
GPIO76_LCD_PCLK,
|
||||||
|
GPIO77_LCD_BIAS,
|
||||||
|
|
||||||
|
/* GPIO KEYS */
|
||||||
|
GPIO5_GPIO, /* notes */
|
||||||
|
GPIO7_GPIO, /* tasks */
|
||||||
|
GPIO11_GPIO, /* calendar */
|
||||||
|
GPIO13_GPIO, /* contacts */
|
||||||
|
GPIO14_GPIO, /* center */
|
||||||
|
GPIO19_GPIO, /* left */
|
||||||
|
GPIO20_GPIO, /* right */
|
||||||
|
GPIO21_GPIO, /* down */
|
||||||
|
GPIO22_GPIO, /* up */
|
||||||
|
|
||||||
|
/* MISC */
|
||||||
|
GPIO1_RST, /* reset */
|
||||||
|
GPIO4_GPIO, /* Hotsync button */
|
||||||
|
GPIO9_GPIO, /* power detect */
|
||||||
|
GPIO37_GPIO, /* LCD power */
|
||||||
|
GPIO56_GPIO, /* Backlight power */
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* SD/MMC card controller
|
||||||
|
******************************************************************************/
|
||||||
|
static int palmte2_mci_init(struct device *dev,
|
||||||
|
irq_handler_t palmte2_detect_int, void *data)
|
||||||
|
{
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
/* Setup an interrupt for detecting card insert/remove events */
|
||||||
|
err = gpio_request(GPIO_NR_PALMTE2_SD_DETECT_N, "SD IRQ");
|
||||||
|
if (err)
|
||||||
|
goto err;
|
||||||
|
err = gpio_direction_input(GPIO_NR_PALMTE2_SD_DETECT_N);
|
||||||
|
if (err)
|
||||||
|
goto err2;
|
||||||
|
err = request_irq(gpio_to_irq(GPIO_NR_PALMTE2_SD_DETECT_N),
|
||||||
|
palmte2_detect_int, IRQF_DISABLED | IRQF_SAMPLE_RANDOM |
|
||||||
|
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
|
||||||
|
"SD/MMC card detect", data);
|
||||||
|
if (err) {
|
||||||
|
printk(KERN_ERR "%s: cannot request SD/MMC card detect IRQ\n",
|
||||||
|
__func__);
|
||||||
|
goto err2;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = gpio_request(GPIO_NR_PALMTE2_SD_POWER, "SD_POWER");
|
||||||
|
if (err)
|
||||||
|
goto err3;
|
||||||
|
err = gpio_direction_output(GPIO_NR_PALMTE2_SD_POWER, 0);
|
||||||
|
if (err)
|
||||||
|
goto err4;
|
||||||
|
|
||||||
|
err = gpio_request(GPIO_NR_PALMTE2_SD_READONLY, "SD_READONLY");
|
||||||
|
if (err)
|
||||||
|
goto err4;
|
||||||
|
err = gpio_direction_input(GPIO_NR_PALMTE2_SD_READONLY);
|
||||||
|
if (err)
|
||||||
|
goto err5;
|
||||||
|
|
||||||
|
printk(KERN_DEBUG "%s: irq registered\n", __func__);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err5:
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_SD_READONLY);
|
||||||
|
err4:
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_SD_POWER);
|
||||||
|
err3:
|
||||||
|
free_irq(gpio_to_irq(GPIO_NR_PALMTE2_SD_DETECT_N), data);
|
||||||
|
err2:
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_SD_DETECT_N);
|
||||||
|
err:
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void palmte2_mci_exit(struct device *dev, void *data)
|
||||||
|
{
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_SD_READONLY);
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_SD_POWER);
|
||||||
|
free_irq(gpio_to_irq(GPIO_NR_PALMTE2_SD_DETECT_N), data);
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_SD_DETECT_N);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void palmte2_mci_power(struct device *dev, unsigned int vdd)
|
||||||
|
{
|
||||||
|
struct pxamci_platform_data *p_d = dev->platform_data;
|
||||||
|
gpio_set_value(GPIO_NR_PALMTE2_SD_POWER, p_d->ocr_mask & (1 << vdd));
|
||||||
|
}
|
||||||
|
|
||||||
|
static int palmte2_mci_get_ro(struct device *dev)
|
||||||
|
{
|
||||||
|
return gpio_get_value(GPIO_NR_PALMTE2_SD_READONLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct pxamci_platform_data palmte2_mci_platform_data = {
|
||||||
|
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
|
||||||
|
.setpower = palmte2_mci_power,
|
||||||
|
.get_ro = palmte2_mci_get_ro,
|
||||||
|
.init = palmte2_mci_init,
|
||||||
|
.exit = palmte2_mci_exit,
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* GPIO keys
|
||||||
|
******************************************************************************/
|
||||||
|
static struct gpio_keys_button palmte2_pxa_buttons[] = {
|
||||||
|
{KEY_F1, GPIO_NR_PALMTE2_KEY_CONTACTS, 1, "Contacts" },
|
||||||
|
{KEY_F2, GPIO_NR_PALMTE2_KEY_CALENDAR, 1, "Calendar" },
|
||||||
|
{KEY_F3, GPIO_NR_PALMTE2_KEY_TASKS, 1, "Tasks" },
|
||||||
|
{KEY_F4, GPIO_NR_PALMTE2_KEY_NOTES, 1, "Notes" },
|
||||||
|
{KEY_ENTER, GPIO_NR_PALMTE2_KEY_CENTER, 1, "Center" },
|
||||||
|
{KEY_LEFT, GPIO_NR_PALMTE2_KEY_LEFT, 1, "Left" },
|
||||||
|
{KEY_RIGHT, GPIO_NR_PALMTE2_KEY_RIGHT, 1, "Right" },
|
||||||
|
{KEY_DOWN, GPIO_NR_PALMTE2_KEY_DOWN, 1, "Down" },
|
||||||
|
{KEY_UP, GPIO_NR_PALMTE2_KEY_UP, 1, "Up" },
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct gpio_keys_platform_data palmte2_pxa_keys_data = {
|
||||||
|
.buttons = palmte2_pxa_buttons,
|
||||||
|
.nbuttons = ARRAY_SIZE(palmte2_pxa_buttons),
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device palmte2_pxa_keys = {
|
||||||
|
.name = "gpio-keys",
|
||||||
|
.id = -1,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = &palmte2_pxa_keys_data,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Backlight
|
||||||
|
******************************************************************************/
|
||||||
|
static int palmte2_backlight_init(struct device *dev)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = gpio_request(GPIO_NR_PALMTE2_BL_POWER, "BL POWER");
|
||||||
|
if (ret)
|
||||||
|
goto err;
|
||||||
|
ret = gpio_direction_output(GPIO_NR_PALMTE2_BL_POWER, 0);
|
||||||
|
if (ret)
|
||||||
|
goto err2;
|
||||||
|
ret = gpio_request(GPIO_NR_PALMTE2_LCD_POWER, "LCD POWER");
|
||||||
|
if (ret)
|
||||||
|
goto err2;
|
||||||
|
ret = gpio_direction_output(GPIO_NR_PALMTE2_LCD_POWER, 0);
|
||||||
|
if (ret)
|
||||||
|
goto err3;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
err3:
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_LCD_POWER);
|
||||||
|
err2:
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_BL_POWER);
|
||||||
|
err:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int palmte2_backlight_notify(int brightness)
|
||||||
|
{
|
||||||
|
gpio_set_value(GPIO_NR_PALMTE2_BL_POWER, brightness);
|
||||||
|
gpio_set_value(GPIO_NR_PALMTE2_LCD_POWER, brightness);
|
||||||
|
return brightness;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void palmte2_backlight_exit(struct device *dev)
|
||||||
|
{
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_BL_POWER);
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_LCD_POWER);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct platform_pwm_backlight_data palmte2_backlight_data = {
|
||||||
|
.pwm_id = 0,
|
||||||
|
.max_brightness = PALMTE2_MAX_INTENSITY,
|
||||||
|
.dft_brightness = PALMTE2_MAX_INTENSITY,
|
||||||
|
.pwm_period_ns = PALMTE2_PERIOD_NS,
|
||||||
|
.init = palmte2_backlight_init,
|
||||||
|
.notify = palmte2_backlight_notify,
|
||||||
|
.exit = palmte2_backlight_exit,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device palmte2_backlight = {
|
||||||
|
.name = "pwm-backlight",
|
||||||
|
.dev = {
|
||||||
|
.parent = &pxa25x_device_pwm0.dev,
|
||||||
|
.platform_data = &palmte2_backlight_data,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* IrDA
|
||||||
|
******************************************************************************/
|
||||||
|
static int palmte2_irda_startup(struct device *dev)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
err = gpio_request(GPIO_NR_PALMTE2_IR_DISABLE, "IR DISABLE");
|
||||||
|
if (err)
|
||||||
|
goto err;
|
||||||
|
err = gpio_direction_output(GPIO_NR_PALMTE2_IR_DISABLE, 1);
|
||||||
|
if (err)
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_IR_DISABLE);
|
||||||
|
err:
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void palmte2_irda_shutdown(struct device *dev)
|
||||||
|
{
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_IR_DISABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void palmte2_irda_transceiver_mode(struct device *dev, int mode)
|
||||||
|
{
|
||||||
|
gpio_set_value(GPIO_NR_PALMTE2_IR_DISABLE, mode & IR_OFF);
|
||||||
|
pxa2xx_transceiver_mode(dev, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct pxaficp_platform_data palmte2_ficp_platform_data = {
|
||||||
|
.startup = palmte2_irda_startup,
|
||||||
|
.shutdown = palmte2_irda_shutdown,
|
||||||
|
.transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
|
||||||
|
.transceiver_mode = palmte2_irda_transceiver_mode,
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* UDC
|
||||||
|
******************************************************************************/
|
||||||
|
static struct pxa2xx_udc_mach_info palmte2_udc_info __initdata = {
|
||||||
|
.gpio_vbus = GPIO_NR_PALMTE2_USB_DETECT_N,
|
||||||
|
.gpio_vbus_inverted = 1,
|
||||||
|
.gpio_pullup = GPIO_NR_PALMTE2_USB_PULLUP,
|
||||||
|
.gpio_pullup_inverted = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Power supply
|
||||||
|
******************************************************************************/
|
||||||
|
static int power_supply_init(struct device *dev)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = gpio_request(GPIO_NR_PALMTE2_POWER_DETECT, "CABLE_STATE_AC");
|
||||||
|
if (ret)
|
||||||
|
goto err1;
|
||||||
|
ret = gpio_direction_input(GPIO_NR_PALMTE2_POWER_DETECT);
|
||||||
|
if (ret)
|
||||||
|
goto err2;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err2:
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_POWER_DETECT);
|
||||||
|
err1:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int palmte2_is_ac_online(void)
|
||||||
|
{
|
||||||
|
return gpio_get_value(GPIO_NR_PALMTE2_POWER_DETECT);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void power_supply_exit(struct device *dev)
|
||||||
|
{
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_POWER_DETECT);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *palmte2_supplicants[] = {
|
||||||
|
"main-battery",
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct pda_power_pdata power_supply_info = {
|
||||||
|
.init = power_supply_init,
|
||||||
|
.is_ac_online = palmte2_is_ac_online,
|
||||||
|
.exit = power_supply_exit,
|
||||||
|
.supplied_to = palmte2_supplicants,
|
||||||
|
.num_supplicants = ARRAY_SIZE(palmte2_supplicants),
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device power_supply = {
|
||||||
|
.name = "pda-power",
|
||||||
|
.id = -1,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = &power_supply_info,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* WM97xx battery
|
||||||
|
******************************************************************************/
|
||||||
|
static struct wm97xx_batt_info wm97xx_batt_pdata = {
|
||||||
|
.batt_aux = WM97XX_AUX_ID3,
|
||||||
|
.temp_aux = WM97XX_AUX_ID2,
|
||||||
|
.charge_gpio = -1,
|
||||||
|
.max_voltage = PALMTE2_BAT_MAX_VOLTAGE,
|
||||||
|
.min_voltage = PALMTE2_BAT_MIN_VOLTAGE,
|
||||||
|
.batt_mult = 1000,
|
||||||
|
.batt_div = 414,
|
||||||
|
.temp_mult = 1,
|
||||||
|
.temp_div = 1,
|
||||||
|
.batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
|
||||||
|
.batt_name = "main-batt",
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Framebuffer
|
||||||
|
******************************************************************************/
|
||||||
|
static struct pxafb_mode_info palmte2_lcd_modes[] = {
|
||||||
|
{
|
||||||
|
.pixclock = 77757,
|
||||||
|
.xres = 320,
|
||||||
|
.yres = 320,
|
||||||
|
.bpp = 16,
|
||||||
|
|
||||||
|
.left_margin = 28,
|
||||||
|
.right_margin = 7,
|
||||||
|
.upper_margin = 7,
|
||||||
|
.lower_margin = 5,
|
||||||
|
|
||||||
|
.hsync_len = 4,
|
||||||
|
.vsync_len = 1,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct pxafb_mach_info palmte2_lcd_screen = {
|
||||||
|
.modes = palmte2_lcd_modes,
|
||||||
|
.num_modes = ARRAY_SIZE(palmte2_lcd_modes),
|
||||||
|
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Machine init
|
||||||
|
******************************************************************************/
|
||||||
|
static struct platform_device *devices[] __initdata = {
|
||||||
|
#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
|
||||||
|
&palmte2_pxa_keys,
|
||||||
|
#endif
|
||||||
|
&palmte2_backlight,
|
||||||
|
&power_supply,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* setup udc GPIOs initial state */
|
||||||
|
static void __init palmte2_udc_init(void)
|
||||||
|
{
|
||||||
|
if (!gpio_request(GPIO_NR_PALMTE2_USB_PULLUP, "UDC Vbus")) {
|
||||||
|
gpio_direction_output(GPIO_NR_PALMTE2_USB_PULLUP, 1);
|
||||||
|
gpio_free(GPIO_NR_PALMTE2_USB_PULLUP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __init palmte2_init(void)
|
||||||
|
{
|
||||||
|
pxa2xx_mfp_config(ARRAY_AND_SIZE(palmte2_pin_config));
|
||||||
|
|
||||||
|
set_pxa_fb_info(&palmte2_lcd_screen);
|
||||||
|
pxa_set_mci_info(&palmte2_mci_platform_data);
|
||||||
|
palmte2_udc_init();
|
||||||
|
pxa_set_udc_info(&palmte2_udc_info);
|
||||||
|
pxa_set_ac97_info(NULL);
|
||||||
|
pxa_set_ficp_info(&palmte2_ficp_platform_data);
|
||||||
|
wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
|
||||||
|
|
||||||
|
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||||
|
}
|
||||||
|
|
||||||
|
MACHINE_START(PALMTE2, "Palm Tungsten|E2")
|
||||||
|
.phys_io = 0x40000000,
|
||||||
|
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||||
|
.boot_params = 0xa0000100,
|
||||||
|
.map_io = pxa_map_io,
|
||||||
|
.init_irq = pxa25x_init_irq,
|
||||||
|
.timer = &pxa_timer,
|
||||||
|
.init_machine = palmte2_init
|
||||||
|
MACHINE_END
|
|
@ -93,10 +93,10 @@ static unsigned long palmtx_pin_config[] __initdata = {
|
||||||
GPIO116_GPIO, /* wifi ready */
|
GPIO116_GPIO, /* wifi ready */
|
||||||
|
|
||||||
/* MATRIX KEYPAD */
|
/* MATRIX KEYPAD */
|
||||||
GPIO100_KP_MKIN_0,
|
GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO101_KP_MKIN_1,
|
GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO102_KP_MKIN_2,
|
GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO97_KP_MKIN_3,
|
GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
|
||||||
GPIO103_KP_MKOUT_0,
|
GPIO103_KP_MKOUT_0,
|
||||||
GPIO104_KP_MKOUT_1,
|
GPIO104_KP_MKOUT_1,
|
||||||
GPIO105_KP_MKOUT_2,
|
GPIO105_KP_MKOUT_2,
|
||||||
|
@ -458,6 +458,33 @@ static struct pxafb_mach_info palmtx_lcd_screen = {
|
||||||
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
|
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Power management - standby
|
||||||
|
******************************************************************************/
|
||||||
|
#ifdef CONFIG_PM
|
||||||
|
static u32 *addr __initdata;
|
||||||
|
static u32 resume[3] __initdata = {
|
||||||
|
0xe3a00101, /* mov r0, #0x40000000 */
|
||||||
|
0xe380060f, /* orr r0, r0, #0x00f00000 */
|
||||||
|
0xe590f008, /* ldr pc, [r0, #0x08] */
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __init palmtx_pm_init(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* this is where the bootloader jumps */
|
||||||
|
addr = phys_to_virt(PALMTX_STR_BASE);
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++)
|
||||||
|
addr[i] = resume[i];
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
device_initcall(palmtx_pm_init);
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Machine init
|
* Machine init
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include <mach/udc.h>
|
#include <mach/udc.h>
|
||||||
#include <mach/tosa_bt.h>
|
#include <mach/tosa_bt.h>
|
||||||
#include <mach/pxa2xx_spi.h>
|
#include <mach/pxa2xx_spi.h>
|
||||||
|
#include <mach/audio.h>
|
||||||
|
|
||||||
#include <asm/mach/arch.h>
|
#include <asm/mach/arch.h>
|
||||||
#include <mach/tosa.h>
|
#include <mach/tosa.h>
|
||||||
|
@ -914,6 +915,7 @@ static void __init tosa_init(void)
|
||||||
pxa_set_udc_info(&udc_info);
|
pxa_set_udc_info(&udc_info);
|
||||||
pxa_set_ficp_info(&tosa_ficp_platform_data);
|
pxa_set_ficp_info(&tosa_ficp_platform_data);
|
||||||
pxa_set_i2c_info(NULL);
|
pxa_set_i2c_info(NULL);
|
||||||
|
pxa_set_ac97_info(NULL);
|
||||||
platform_scoop_config = &tosa_pcmcia_config;
|
platform_scoop_config = &tosa_pcmcia_config;
|
||||||
|
|
||||||
pxa2xx_set_spi_info(2, &pxa_ssp_master_info);
|
pxa2xx_set_spi_info(2, &pxa_ssp_master_info);
|
||||||
|
|
|
@ -828,6 +828,17 @@ void __init reserve_node_zero(pg_data_t *pgdat)
|
||||||
BOOTMEM_DEFAULT);
|
BOOTMEM_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (machine_is_palmld() || machine_is_palmtx()) {
|
||||||
|
reserve_bootmem_node(pgdat, 0xa0000000, 0x1000,
|
||||||
|
BOOTMEM_EXCLUSIVE);
|
||||||
|
reserve_bootmem_node(pgdat, 0xa0200000, 0x1000,
|
||||||
|
BOOTMEM_EXCLUSIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (machine_is_palmt5())
|
||||||
|
reserve_bootmem_node(pgdat, 0xa0200000, 0x1000,
|
||||||
|
BOOTMEM_EXCLUSIVE);
|
||||||
|
|
||||||
#ifdef CONFIG_SA1111
|
#ifdef CONFIG_SA1111
|
||||||
/*
|
/*
|
||||||
* Because of the SA1111 DMA bug, we want to preserve our
|
* Because of the SA1111 DMA bug, we want to preserve our
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue