-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Randy Dunlap
authored and
David Woodhouse
committed
Jun 1, 2011
1 parent
36b67e3
commit 905a544
Showing
443 changed files
with
5,709 additions
and
14,109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 5c6cce92bc8aee751aafe82c5d9caf7553226a3d | ||
refs/heads/master: 63da029015b5255915cd6d61f19ffc276ad4635d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1 @@ | ||
DMA Engine API Guide | ||
==================== | ||
|
||
Vinod Koul <vinod dot koul at intel.com> | ||
|
||
NOTE: For DMA Engine usage in async_tx please see: | ||
Documentation/crypto/async-tx-api.txt | ||
|
||
|
||
Below is a guide to device driver writers on how to use the Slave-DMA API of the | ||
DMA Engine. This is applicable only for slave DMA usage only. | ||
|
||
The slave DMA usage consists of following steps | ||
1. Allocate a DMA slave channel | ||
2. Set slave and controller specific parameters | ||
3. Get a descriptor for transaction | ||
4. Submit the transaction and wait for callback notification | ||
|
||
1. Allocate a DMA slave channel | ||
Channel allocation is slightly different in the slave DMA context, client | ||
drivers typically need a channel from a particular DMA controller only and even | ||
in some cases a specific channel is desired. To request a channel | ||
dma_request_channel() API is used. | ||
|
||
Interface: | ||
struct dma_chan *dma_request_channel(dma_cap_mask_t mask, | ||
dma_filter_fn filter_fn, | ||
void *filter_param); | ||
where dma_filter_fn is defined as: | ||
typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param); | ||
|
||
When the optional 'filter_fn' parameter is set to NULL dma_request_channel | ||
simply returns the first channel that satisfies the capability mask. Otherwise, | ||
when the mask parameter is insufficient for specifying the necessary channel, | ||
the filter_fn routine can be used to disposition the available channels in the | ||
system. The filter_fn routine is called once for each free channel in the | ||
system. Upon seeing a suitable channel filter_fn returns DMA_ACK which flags | ||
that channel to be the return value from dma_request_channel. A channel | ||
allocated via this interface is exclusive to the caller, until | ||
dma_release_channel() is called. | ||
|
||
2. Set slave and controller specific parameters | ||
Next step is always to pass some specific information to the DMA driver. Most of | ||
the generic information which a slave DMA can use is in struct dma_slave_config. | ||
It allows the clients to specify DMA direction, DMA addresses, bus widths, DMA | ||
burst lengths etc. If some DMA controllers have more parameters to be sent then | ||
they should try to embed struct dma_slave_config in their controller specific | ||
structure. That gives flexibility to client to pass more parameters, if | ||
required. | ||
|
||
Interface: | ||
int dmaengine_slave_config(struct dma_chan *chan, | ||
struct dma_slave_config *config) | ||
|
||
3. Get a descriptor for transaction | ||
For slave usage the various modes of slave transfers supported by the | ||
DMA-engine are: | ||
slave_sg - DMA a list of scatter gather buffers from/to a peripheral | ||
dma_cyclic - Perform a cyclic DMA operation from/to a peripheral till the | ||
operation is explicitly stopped. | ||
The non NULL return of this transfer API represents a "descriptor" for the given | ||
transaction. | ||
|
||
Interface: | ||
struct dma_async_tx_descriptor *(*chan->device->device_prep_dma_sg)( | ||
struct dma_chan *chan, | ||
struct scatterlist *dst_sg, unsigned int dst_nents, | ||
struct scatterlist *src_sg, unsigned int src_nents, | ||
unsigned long flags); | ||
struct dma_async_tx_descriptor *(*chan->device->device_prep_dma_cyclic)( | ||
struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | ||
size_t period_len, enum dma_data_direction direction); | ||
|
||
4. Submit the transaction and wait for callback notification | ||
To schedule the transaction to be scheduled by dma device, the "descriptor" | ||
returned in above (3) needs to be submitted. | ||
To tell the dma driver that a transaction is ready to be serviced, the | ||
descriptor->submit() callback needs to be invoked. This chains the descriptor to | ||
the pending queue. | ||
The transactions in the pending queue can be activated by calling the | ||
issue_pending API. If channel is idle then the first transaction in queue is | ||
started and subsequent ones queued up. | ||
On completion of the DMA operation the next in queue is submitted and a tasklet | ||
triggered. The tasklet would then call the client driver completion callback | ||
routine for notification, if set. | ||
Interface: | ||
void dma_async_issue_pending(struct dma_chan *chan); | ||
|
||
============================================================================== | ||
|
||
Additional usage notes for dma driver writers | ||
1/ Although DMA engine specifies that completion callback routines cannot submit | ||
any new operations, but typically for slave DMA subsequent transaction may not | ||
be available for submit prior to callback routine being called. This requirement | ||
is not a requirement for DMA-slave devices. But they should take care to drop | ||
the spin-lock they might be holding before calling the callback routine | ||
See Documentation/crypto/async-tx-api.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
Acer Laptop WMI Extras Driver | ||
http://code.google.com/p/aceracpi | ||
Version 0.3 | ||
4th April 2009 | ||
|
||
Copyright 2007-2009 Carlos Corbacho <carlos@strangeworlds.co.uk> | ||
|
||
acer-wmi is a driver to allow you to control various parts of your Acer laptop | ||
hardware under Linux which are exposed via ACPI-WMI. | ||
|
||
This driver completely replaces the old out-of-tree acer_acpi, which I am | ||
currently maintaining for bug fixes only on pre-2.6.25 kernels. All development | ||
work is now focused solely on acer-wmi. | ||
|
||
Disclaimer | ||
********** | ||
|
||
Acer and Wistron have provided nothing towards the development acer_acpi or | ||
acer-wmi. All information we have has been through the efforts of the developers | ||
and the users to discover as much as possible about the hardware. | ||
|
||
As such, I do warn that this could break your hardware - this is extremely | ||
unlikely of course, but please bear this in mind. | ||
|
||
Background | ||
********** | ||
|
||
acer-wmi is derived from acer_acpi, originally developed by Mark | ||
Smith in 2005, then taken over by Carlos Corbacho in 2007, in order to activate | ||
the wireless LAN card under a 64-bit version of Linux, as acerhk[1] (the | ||
previous solution to the problem) relied on making 32 bit BIOS calls which are | ||
not possible in kernel space from a 64 bit OS. | ||
|
||
[1] acerhk: http://www.cakey.de/acerhk/ | ||
|
||
Supported Hardware | ||
****************** | ||
|
||
NOTE: The Acer Aspire One is not supported hardware. It cannot work with | ||
acer-wmi until Acer fix their ACPI-WMI implementation on them, so has been | ||
blacklisted until that happens. | ||
|
||
Please see the website for the current list of known working hardware: | ||
|
||
http://code.google.com/p/aceracpi/wiki/SupportedHardware | ||
|
||
If your laptop is not listed, or listed as unknown, and works with acer-wmi, | ||
please contact me with a copy of the DSDT. | ||
|
||
If your Acer laptop doesn't work with acer-wmi, I would also like to see the | ||
DSDT. | ||
|
||
To send me the DSDT, as root/sudo: | ||
|
||
cat /sys/firmware/acpi/tables/DSDT > dsdt | ||
|
||
And send me the resulting 'dsdt' file. | ||
|
||
Usage | ||
***** | ||
|
||
On Acer laptops, acer-wmi should already be autoloaded based on DMI matching. | ||
For non-Acer laptops, until WMI based autoloading support is added, you will | ||
need to manually load acer-wmi. | ||
|
||
acer-wmi creates /sys/devices/platform/acer-wmi, and fills it with various | ||
files whose usage is detailed below, which enables you to control some of the | ||
following (varies between models): | ||
|
||
* the wireless LAN card radio | ||
* inbuilt Bluetooth adapter | ||
* inbuilt 3G card | ||
* mail LED of your laptop | ||
* brightness of the LCD panel | ||
|
||
Wireless | ||
******** | ||
|
||
With regards to wireless, all acer-wmi does is enable the radio on the card. It | ||
is not responsible for the wireless LED - once the radio is enabled, this is | ||
down to the wireless driver for your card. So the behaviour of the wireless LED, | ||
once you enable the radio, will depend on your hardware and driver combination. | ||
|
||
e.g. With the BCM4318 on the Acer Aspire 5020 series: | ||
|
||
ndiswrapper: Light blinks on when transmitting | ||
b43: Solid light, blinks off when transmitting | ||
|
||
Wireless radio control is unconditionally enabled - all Acer laptops that support | ||
acer-wmi come with built-in wireless. However, should you feel so inclined to | ||
ever wish to remove the card, or swap it out at some point, please get in touch | ||
with me, as we may well be able to gain some data on wireless card detection. | ||
|
||
The wireless radio is exposed through rfkill. | ||
|
||
Bluetooth | ||
********* | ||
|
||
For bluetooth, this is an internal USB dongle, so once enabled, you will get | ||
a USB device connection event, and a new USB device appears. When you disable | ||
bluetooth, you get the reverse - a USB device disconnect event, followed by the | ||
device disappearing again. | ||
|
||
Bluetooth is autodetected by acer-wmi, so if you do not have a bluetooth module | ||
installed in your laptop, this file won't exist (please be aware that it is | ||
quite common for Acer not to fit bluetooth to their laptops - so just because | ||
you have a bluetooth button on the laptop, doesn't mean that bluetooth is | ||
installed). | ||
|
||
For the adventurously minded - if you want to buy an internal bluetooth | ||
module off the internet that is compatible with your laptop and fit it, then | ||
it will work just fine with acer-wmi. | ||
|
||
Bluetooth is exposed through rfkill. | ||
|
||
3G | ||
** | ||
|
||
3G is currently not autodetected, so the 'threeg' file is always created under | ||
sysfs. So far, no-one in possession of an Acer laptop with 3G built-in appears to | ||
have tried Linux, or reported back, so we don't have any information on this. | ||
|
||
If you have an Acer laptop that does have a 3G card in, please contact me so we | ||
can properly detect these, and find out a bit more about them. | ||
|
||
To read the status of the 3G card (0=off, 1=on): | ||
cat /sys/devices/platform/acer-wmi/threeg | ||
|
||
To enable the 3G card: | ||
echo 1 > /sys/devices/platform/acer-wmi/threeg | ||
|
||
To disable the 3G card: | ||
echo 0 > /sys/devices/platform/acer-wmi/threeg | ||
|
||
To set the state of the 3G card when loading acer-wmi, pass: | ||
threeg=X (where X is 0 or 1) | ||
|
||
Mail LED | ||
******** | ||
|
||
This can be found in most older Acer laptops supported by acer-wmi, and many | ||
newer ones - it is built into the 'mail' button, and blinks when active. | ||
|
||
On newer (WMID) laptops though, we have no way of detecting the mail LED. If | ||
your laptop identifies itself in dmesg as a WMID model, then please try loading | ||
acer_acpi with: | ||
|
||
force_series=2490 | ||
|
||
This will use a known alternative method of reading/ writing the mail LED. If | ||
it works, please report back to me with the DMI data from your laptop so this | ||
can be added to acer-wmi. | ||
|
||
The LED is exposed through the LED subsystem, and can be found in: | ||
|
||
/sys/devices/platform/acer-wmi/leds/acer-wmi::mail/ | ||
|
||
The mail LED is autodetected, so if you don't have one, the LED device won't | ||
be registered. | ||
|
||
Backlight | ||
********* | ||
|
||
The backlight brightness control is available on all acer-wmi supported | ||
hardware. The maximum brightness level is usually 15, but on some newer laptops | ||
it's 10 (this is again autodetected). | ||
|
||
The backlight is exposed through the backlight subsystem, and can be found in: | ||
|
||
/sys/devices/platform/acer-wmi/backlight/acer-wmi/ | ||
|
||
Credits | ||
******* | ||
|
||
Olaf Tauber, who did the real hard work when he developed acerhk | ||
http://www.cakey.de/acerhk/ | ||
All the authors of laptop ACPI modules in the kernel, whose work | ||
was an inspiration in the early days of acer_acpi | ||
Mathieu Segaud, who solved the problem with having to modprobe the driver | ||
twice in acer_acpi 0.2. | ||
Jim Ramsay, who added support for the WMID interface | ||
Mark Smith, who started the original acer_acpi | ||
|
||
And the many people who have used both acer_acpi and acer-wmi. |
Oops, something went wrong.