1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 #include <device/pnp_ops.h>
8 void pnp_enter_ext_func_mode(pnp_devfn_t dev
)
15 void pnp_exit_ext_func_mode(pnp_devfn_t dev
)
22 * Select Pin 89, Pin 90 function as I2C interface SDA, SCL.
23 * {Pin 89, Pin 90} function can be selected as {GP33, GP32}, or
24 * {RSTOUT3#, RSTOUT2#} or {SDA, SCL}
26 void w83627dhg_enable_i2c(pnp_devfn_t dev
)
30 pnp_enter_ext_func_mode(dev
);
31 pnp_set_logical_device(dev
);
33 val
= pnp_read_config(dev
, 0x2A);
35 pnp_write_config(dev
, 0x2A, val
);
37 pnp_exit_ext_func_mode(dev
);
40 void w83627dhg_set_clksel_48(pnp_devfn_t dev
)
44 pnp_enter_ext_func_mode(dev
);
45 reg8
= pnp_read_config(dev
, 0x24);
46 reg8
|= (1 << 6); /* Set CLKSEL (clock input on pin 1) to 48MHz. */
47 pnp_write_config(dev
, 0x24, reg8
);
48 pnp_exit_ext_func_mode(dev
);