コード例 #1
0
int xmm626_sec_modem_power(int device_fd, int power)
{
    int rc;

    rc = sysfs_value_write(XMM626_SEC_MODEM_POWER_PATH, !!power);
    if (rc < 0)
        return -1;

    return 0;
}
コード例 #2
0
int xmm626_sec_modem_link_control_active(int device_fd, int active)
{
    int rc;

    rc = sysfs_value_write(XMM626_SEC_LINK_ACTIVE_PATH, !!active);
    if (rc < 0)
        return -1;

    return 0;
}
コード例 #3
0
int cm36651_light_set_delay(struct smdk4x12_sensors_handlers *handlers, int64_t delay)
{
	struct cm36651_light_data *data;
	int rc;

	ALOGD("%s(%p, %" PRId64 ")", __func__, handlers, delay);

	if (handlers == NULL || handlers->data == NULL)
		return -EINVAL;

	data = (struct cm36651_light_data *) handlers->data;

	rc = sysfs_value_write(data->path_delay, delay);
	if (rc < 0) {
		ALOGE("%s: Unable to write sysfs value", __func__);
		return -1;
	}

	return 0;
}
コード例 #4
0
int cm36651_light_deactivate(struct smdk4x12_sensors_handlers *handlers)
{
	struct cm36651_light_data *data;
	int rc;

	ALOGD("%s(%p)", __func__, handlers);

	if (handlers == NULL || handlers->data == NULL)
		return -EINVAL;

	data = (struct cm36651_light_data *) handlers->data;

	rc = sysfs_value_write(data->path_enable, 0);
	if (rc < 0) {
		ALOGE("%s: Unable to write sysfs value", __func__);
		return -1;
	}

	handlers->activated = 1;

	return 0;
}
コード例 #5
0
int xmm626_sec_modem_hci_power(int power)
{
    int ehci_rc, ohci_rc = -1;

    
    /*ohci_rc = sysfs_value_write(XMM626_SEC_MODEM_OHCI_POWER_SYSFS, !!power);
    if (ohci_rc >= 0)
        usleep(50000);
*/

    if (!!power) {
	ohci_rc = sysfs_value_write(XMM626_SEC_MODEM_PDA_ACTIVE_SYSFS, 1);
	if (sysfs_value_read(XMM626_SEC_HOSTWAKE_PATH)) {
		ohci_rc |= sysfs_value_write(XMM626_SEC_MODEM_SLAVEWAKE_SYSFS, 0);
		usleep(10000);
		ohci_rc |= sysfs_value_write(XMM626_SEC_MODEM_SLAVEWAKE_SYSFS, 1);
	}
	ehci_rc = sysfs_value_write(XMM626_SEC_MODEM_EHCI_POWER_SYSFS, !!power);
	if (ehci_rc >= 0)
		usleep(50000);

	ohci_rc |= sysfs_value_write(XMM626_SEC_LINK_ACTIVE_PATH, 1);
    } else {
	    ehci_rc = sysfs_value_write(XMM626_SEC_MODEM_EHCI_POWER_SYSFS, !!power);
	if (ehci_rc >= 0)
		usleep(50000);

	//ohci_rc = sysfs_value_write(XMM626_SEC_MODEM_PDA_ACTIVE_SYSFS, 0);
	ohci_rc = sysfs_value_write(XMM626_SEC_LINK_ACTIVE_PATH, 0);
    }


    if (ohci_rc < 0) {
	printf("ohci_rc < 0\n");
    }
    if (ehci_rc < 0 && ohci_rc < 0)
        return -1;

    return 0;
}