Example #1
0
static int switch_to_cp_uart(struct max14577_muic_data *muic_data)
{
	int ret = 0;

	if (muic_data->attached_dev != ATTACHED_DEV_JIG_UART_OFF_MUIC)
		pr_warn("%s:%s current attached is (%d) not Jig UART Off\n",
				MUIC_DEV_NAME, __func__,
				muic_data->attached_dev);
	else
		ret = com_to_uart(muic_data);

	return ret;
}
static ssize_t max14577_muic_store_manual_sw(struct device *dev,
					  struct device_attribute *attr,
					  const char *buf, size_t count)
{
	struct max14577_muic_data *muic_data = dev_get_drvdata(dev);

	if (!strncasecmp(buf, "OPEN", 4))		com_to_open(muic_data);
	else if (!strncasecmp(buf, "USB", 3))	com_to_usb(muic_data);
	else if (!strncasecmp(buf, "AUDIO", 5))	com_to_audio(muic_data);
	else if (!strncasecmp(buf, "UART", 4))	com_to_uart(muic_data);
	else
		pr_warn("%s:%s invalid value\n", MUIC_DEV_NAME, __func__);

	return count;
}
Example #3
0
static int switch_to_cp_uart(struct tsu6721_muic_data *muic_data)
{
	struct muic_platform_data *pdata = muic_data->pdata;
	int ret = 0;

	pr_info("%s:%s\n", MUIC_DEV_NAME, __func__);

	if (pdata->set_gpio_uart_sel)
		pdata->set_gpio_uart_sel(MUIC_PATH_UART_CP);

	ret = com_to_uart(muic_data);
	if (ret) {
		pr_err("%s:%s com->uart set err\n", MUIC_DEV_NAME, __func__);
		return ret;
	}

	return ret;
}