static void omap_mux_hpd_pull_up(bool on) { struct omap_mux_partition *p = omap_mux_get("core"); u16 mux; mux = omap_mux_read(p, OMAP4_CTRL_MODULE_PAD_HDMI_HPD_OFFSET); if (on) { omap_mux_write(p, mux | OMAP_PULL_UP, OMAP4_CTRL_MODULE_PAD_HDMI_HPD_OFFSET); } else { omap_mux_write(p, mux & ~OMAP_PULL_UP, OMAP4_CTRL_MODULE_PAD_HDMI_HPD_OFFSET); } }
static void mcsdl_set_hw_i2c(void) { static struct omap_mux_partition *partition; printk("\n\n mcsdl_set_hw_i2c\n\n"); partition = kzalloc(sizeof(struct omap_mux_partition), GFP_KERNEL); if (!partition) return -ENOMEM; partition->flags = 0; partition->size = OMAP3_CONTROL_PADCONF_MUX_SIZE; partition->phys = OMAP3_CONTROL_PADCONF_MUX_PBASE; partition->base = ioremap(OMAP3_CONTROL_PADCONF_MUX_PBASE, OMAP3_CONTROL_PADCONF_MUX_SIZE); omap_mux_write(partition, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP, OMAP3_CONTROL_PADCONF_I2C3_SCL_OFFSET); omap_mux_write(partition, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP, OMAP3_CONTROL_PADCONF_I2C3_SDA_OFFSET); mdelay(500); // omap_mux_write_array(partition, tsp_hw_i2c_mux); }
void omap_rts_mux_write(u16 val, int num) { struct omap_hwmod *oh; int i; oh = omap_uart_hwmod_lookup(num); if (!oh) return; for (i = 0; i < oh->mux->nr_pads ; i++) { if (strstr(oh->mux->pads[i].name, "rts")) { omap_mux_write(oh->mux->pads[i].partition, val, oh->mux->pads[i].mux[0].reg_offset); break; } } }
/* Enable clock pull up or clock pull down */ static void omap5_clk_pull_up(struct device *dev, int slot, bool up) { struct omap_mmc_platform_data *mmc = dev->platform_data; struct omap_mux_partition *p_mmc_clk = mmc->slots[0].p_mmc_clk; struct omap_mux *mux_mmc_clk = mmc->slots[0].mux_mmc_clk; u16 r_sdcard_clk = 0; if ((!p_mmc_clk) || (!mux_mmc_clk)) { printk(KERN_ERR "Unable to get SD Card Mux reference\n"); return; } r_sdcard_clk = omap_mux_read(p_mmc_clk, mux_mmc_clk->reg_offset); if (up) r_sdcard_clk |= (0x1 << 4); else r_sdcard_clk &= ~(0x1 << 4); omap_mux_write(p_mmc_clk, r_sdcard_clk, mux_mmc_clk->reg_offset); }
static void __init none_modem_cfg_mux(void) { int i; struct omap_mux_partition *partition; struct omap_mux_partition *core = omap_mux_get("core"); struct omap_mux_partition *wkup = omap_mux_get("wkup"); struct omap_muxtbl *tbl; omap_mux_write_array(core, mux_none_modem); for (i = 0; i < ARRAY_SIZE(modem_gpios); i++) { tbl = omap_muxtbl_find_by_name(modem_gpios[i].label); if (!tbl) continue; if (tbl->domain == OMAP4_MUXTBL_DOMAIN_WKUP) partition = wkup; else partition = core; omap_mux_write(partition, OMAP_MUX_MODE7 | OMAP_PIN_INPUT_PULLDOWN, tbl->mux.reg_offset); } }
int __init omap4_muxtbl_add_mux(struct omap_muxtbl *muxtbl) { struct omap_board_mux *mux = &muxtbl->mux; int wk_mux = muxtbl->domain; struct omap_mux_partition *partition; if (omap4_muxtbl_in_gpio_expander(muxtbl)) return 0; if (unlikely(wk_mux)) partition = wkup_part; else partition = core_part; omap4_muxtbl_set_pbias_gpio_pre(partition, mux); omap_mux_write(partition, mux->value, mux->reg_offset); omap_muxtbl_set_usbbx_gpio(muxtbl); omap4_muxtbl_set_pbias_gpio_post(partition, mux); return 0; }