|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-6CE68645-D8C5-52E1-88B3-76AEFB80DE51" xml:lang="en"><title>Peripherals |
|
13 As Power Resources</title><shortdesc>Peripherals that provide services to other peripherals can be considered |
|
14 as power resources from the point of view of the client driver.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <p>As they can offer a service to more than one other peripheral, we suggest |
|
16 that the driver that manages them presents a <xref href="GUID-10105403-AF16-3908-AE9E-96CF2A03AD3A.dita"><apiname>MPowerInput</apiname></xref> derived |
|
17 interface to client peripheral drivers, providing <codeph>Use()</codeph> and <codeph>Release()</codeph> functions |
|
18 that can be used by dependent peripheral drivers to issue power requests. |
|
19 The driver for the peripheral providing that interface may then use the built-in |
|
20 usage counting feature to control the peripheral power state. </p> |
|
21 <p>A typical example of a shared Peripheral is an Inter-Component serial Bus |
|
22 (I2C, SPI, etc): </p> |
|
23 <codeblock id="GUID-2E454D22-496D-5D9C-9F67-281D6F340459" xml:space="preserve">class MySharedPeripheral : public MPowerInput , (other parent classes) |
|
24 { |
|
25 public: |
|
26 // from MPowerInput |
|
27 void Use(); |
|
28 void Release(); |
|
29 TUint GetCount(); |
|
30 ... |
|
31 (other methods and data members required to model the interface) |
|
32 }; |
|
33 </codeblock> |
|
34 <p>Special care must be taken to not create circular dependencies, for example, |
|
35 Peripheral A depends on Peripheral B, which depends on Peripheral C which |
|
36 depends on Peripheral A. Such circular dependencies would cause the <xref href="GUID-10105403-AF16-3908-AE9E-96CF2A03AD3A.dita#GUID-10105403-AF16-3908-AE9E-96CF2A03AD3A/GUID-606ECD77-A5F7-3408-9B63-C68C0A7B73C6"><apiname>MPowerInput::Release()</apiname></xref> mechanism |
|
37 not to work properly, and preventing the chain of peripherals from powering |
|
38 down when due. </p> |
|
39 <p>The shared peripheral driver’s power handler asynchronous <codeph>PowerDown()</codeph> must |
|
40 examine the usage count of that peripheral if the power manager issues a <codeph>PowerDown()</codeph> request |
|
41 to the shared peripheral driver’s power handler while the peripheral is still |
|
42 in use by another driver. In this situation, the shared peripheral driver |
|
43 must defer powering down until all the dependent peripherals have released |
|
44 their request on it. </p> |
|
45 <p>Some peripherals may also be represented as power resources to prevent |
|
46 the base port power saving operations inhibiting their usage. For example, |
|
47 a base port may consider DRAM to be a shared power resource with the DMA controller, |
|
48 or the DSP controller as clients. This will allow them to still be able to |
|
49 access DRAM whilst the CPU is idling, thus stopping the DRAM going into self-refresh |
|
50 if either one of its clients has pending operations on it. </p> |
|
51 <p>As another example, to save power some base ports might decide to reduce |
|
52 the refresh rate of the LCD whilst the CPU is idling or even power it down |
|
53 for short periods and rely on the persistence of the LCD to prevent degredation |
|
54 of the user experience. However, on a multiple core solution the LCD might |
|
55 be used by the second core (e.g. DSP), for example, for playing back video |
|
56 whilst the main CPU is idling. In this situation the LCD should be represented |
|
57 as a shared power resource and the DSP must be able to request usage of this |
|
58 resource. The DSP controller software could assert a request on the LCD preventing |
|
59 the main CPU from initiating the power saving measures. </p> |
|
60 </conbody></concept> |