mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
imx233/fuze+: rework i2c and fmradio_i2c init
Only enable fmradio_i2c once with _init() called from system. Move actual i2c init to system for consistency. Move tuner power pin setup to power instead of fmradio. Change-Id: Idb56bfba5803f71b5d049f174c48d2afb969a6ea
This commit is contained in:
parent
a4fd5bf7cb
commit
9caffa8bf7
6 changed files with 15 additions and 11 deletions
|
|
@ -85,17 +85,11 @@ struct i2c_interface fmradio_i2c =
|
|||
.delay_thigh = 4
|
||||
};
|
||||
|
||||
void fmradio_i2c_enable(bool enable)
|
||||
void fmradio_i2c_init(void)
|
||||
{
|
||||
if(fmradio_i2c_bus == -1)
|
||||
fmradio_i2c_bus = i2c_add_node(&fmradio_i2c);
|
||||
imx233_set_pin_function(0, 29, PINCTRL_FUNCTION_GPIO);
|
||||
imx233_set_pin_function(1, 24, PINCTRL_FUNCTION_GPIO);
|
||||
imx233_set_pin_function(1, 22, PINCTRL_FUNCTION_GPIO);
|
||||
imx233_enable_gpio_output(1, 22, enable);
|
||||
imx233_enable_gpio_output(1, 24, enable);
|
||||
imx233_set_gpio_output(1, 22, enable);
|
||||
imx233_set_gpio_output(1, 24, enable);
|
||||
fmradio_i2c_bus = i2c_add_node(&fmradio_i2c);
|
||||
}
|
||||
|
||||
int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count)
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ bool tuner_power(bool enable)
|
|||
{
|
||||
if(enable != tuner_enable)
|
||||
{
|
||||
fmradio_i2c_enable(enable);
|
||||
/* CE is B029 (active high) */
|
||||
imx233_set_pin_function(0, 29, PINCTRL_FUNCTION_GPIO);
|
||||
imx233_set_pin_drive_strength(0, 29, PINCTRL_DRIVE_4mA);
|
||||
imx233_enable_gpio_output(0, 29, enable);
|
||||
imx233_set_gpio_output(0, 29, enable);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue