diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-11-19 20:39:10 +0000 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-11-19 20:39:10 +0000 |
commit | 446f352abda2dbc9de90c35a02100ed5e9aad77c (patch) | |
tree | 7ee2b4dae98376e0380b0b8bc44e1e688d10ede2 /firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c | |
parent | c2c2274e0adacc1a0c5bdb57fa1367badb7b047f (diff) | |
download | rockbox-446f352abda2dbc9de90c35a02100ed5e9aad77c.tar.gz rockbox-446f352abda2dbc9de90c35a02100ed5e9aad77c.zip |
imx233: factor fmradio i2c and tuner power code
Choices are limited for those: i2c is either generic software or imx233
hardware and power is either none or with a gpio. So factor ever possible
combination in a single common file and use fmradio-target.h to supply the
required parameters. This will remove a bunch of duplicate code.
Change-Id: If12faeb2e371631cd39cc18a4c1d859812007934
Diffstat (limited to 'firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c')
-rw-r--r-- | firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c deleted file mode 100644 index be087eb140..0000000000 --- a/firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2011 by Amaury Pouly | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "system.h" | ||
23 | #include "power.h" | ||
24 | #include "tuner.h" | ||
25 | #include "fmradio_i2c.h" | ||
26 | #include "pinctrl-imx233.h" | ||
27 | #include "power-imx233.h" | ||
28 | |||
29 | static bool tuner_enable = false; | ||
30 | |||
31 | bool tuner_power(bool enable) | ||
32 | { | ||
33 | if(enable != tuner_enable) | ||
34 | { | ||
35 | /* CE is B0P29 (active high) */ | ||
36 | imx233_pinctrl_acquire(0, 29, "tuner power"); | ||
37 | imx233_pinctrl_set_function(0, 29, PINCTRL_FUNCTION_GPIO); | ||
38 | imx233_pinctrl_set_drive(0, 29, PINCTRL_DRIVE_4mA); | ||
39 | imx233_pinctrl_enable_gpio(0, 29, enable); | ||
40 | imx233_pinctrl_set_gpio(0, 29, enable); | ||
41 | tuner_enable = enable; | ||
42 | /* give time to power up, datasheet states than minimum timing time is | ||
43 | * around 100µs so 1 tick should do */ | ||
44 | sleep(1); | ||
45 | //imx233_power_set_dcdc_freq(enable, HW_POWER_MISC__FREQSEL__24MHz); | ||
46 | } | ||
47 | return tuner_enable; | ||
48 | } | ||
49 | |||
50 | bool tuner_powered(void) | ||
51 | { | ||
52 | return tuner_enable; | ||
53 | } | ||