struct hw_config_power_tree *get_power_config_table(void)
{
	struct board_id_general_struct *power_general_struct = get_board_id_general_struct(POWER_MODULE_NAME);
	struct hw_config_power_tree *power_ptr = NULL;

	if (NULL == power_general_struct) {
		HW_CONFIG_DEBUG("Can not find module:regulator\n");
		return NULL;
	}

	power_ptr = (struct hw_config_power_tree *)power_general_struct->data_array.power_tree_ptr;

	if (NULL == power_ptr) {
		HW_CONFIG_DEBUG("hw_config_power_tree return  NULL\n");
	}
	return power_ptr;
}
int get_nfc_product(void)
{
	unsigned int type = 0;
	bool ret = get_hw_config_int("nfc/nfc_product", &type, NULL);
	HW_CONFIG_DEBUG("hsad: nfc_product = %d\n", type);
	if (ret == true) {
	         return (int)type;
	}
	return 0;
}
struct gpio_config_type *get_gpio_config_table(void)
{
	struct board_id_general_struct *gpios_ptr = get_board_id_general_struct(GPIO_MODULE_NAME);
	struct gpio_config_type *gpio_ptr;

	if (NULL == gpios_ptr) {
		HW_CONFIG_DEBUG(" can not find  module:gpio\n");
		return NULL;
	}

	gpio_ptr = (struct gpio_config_type *)gpios_ptr->data_array.gpio_ptr;

    if (NULL != gpio_ptr) {
		return gpio_ptr;
	} else {
		HW_CONFIG_DEBUG(" return NULL\n");
		return NULL;
	}
}
struct pm_gpio_cfg_t *get_pm_gpio_config_table(void)
{
	struct board_id_general_struct *pm_gpios_ptr = get_board_id_general_struct(PM_GPIO_MODULE_NAME);
	struct pm_gpio_cfg_t *pm_gpio_ptr;

	if (NULL == pm_gpios_ptr) {
		HW_CONFIG_DEBUG(" can not find  module:pm gpio\n");
		return NULL;
	}

	pm_gpio_ptr = (struct pm_gpio_cfg_t *)pm_gpios_ptr->data_array.pm_gpio_ptr;

    if (NULL != pm_gpio_ptr) {
		return pm_gpio_ptr;
	} else {
		HW_CONFIG_DEBUG(" return NULL\n");
		return NULL;
	}
}
int get_sensor_iopower(void)
{
        unsigned int type = 0;

        bool ret = get_hw_config_int("camera/iopower", &type, NULL);
        HW_CONFIG_DEBUG("hsad: camera/iopower = %d\n", type);
        if (ret == true) {
                return type;
        }
        return -1;
}
int get_touchscreen_fw_type(void)
{
	bool ret;
	unsigned int type = 0;
	ret = get_hw_config_int("touchscreen/firmware_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: get_touchscreen_fw_type = %d\n", type);
	if (ret == true)
		return type;

	return -1;
}
/* get correct axis align for touch begin*/
int get_touchscreen_axis_align(void)
{
	bool ret;
	unsigned int type = 0;
	ret = get_hw_config_int("touchscreen/touchscreen_axis_align", &type, NULL);
	HW_CONFIG_DEBUG("hsad: get_touchscreen_axis_align = %d\n", type);
	if (true == ret)
		return type;

	return -1;
}
int get_touchkey_sensitivity_glove(void)
{
    unsigned int type = 0;

    bool ret = get_hw_config_int("touchkey/key_sensitivity_glove", &type, NULL);
    HW_CONFIG_DEBUG("hsad: get_touchkey_sensitivity_glove = %d\n", type);
    if (ret == true) {
        return type;
    }
    return -1;
}
int get_touchkey_led_brightness(void)
{
    unsigned int type = 0;

    bool ret = get_hw_config_int("touchkey/led_brightness", &type, NULL);
    HW_CONFIG_DEBUG("hsad: get_touchkey_led_brightness = %d\n", type);
    if (ret == true) {
        return type;
    }

    return -1;
}
int get_touchkey_regulator_vout(void)
{
    unsigned int type = 0;

    bool ret = get_hw_config_int("touchkey/regulator_vout", &type, NULL);
    HW_CONFIG_DEBUG("hsad: get_touchkey_regulator_vout = %d\n", type);
    if (ret == true) {
        return type;
    }

    return -1;
}
int get_touchkey_led_gpio_enable(void)
{
    int type = 0;

    bool ret = get_hw_config_int("touchkey/led_gpio_008", &type, NULL);
    HW_CONFIG_DEBUG("hsad: get_touchkey_led_gpio_enable = %d\n", type);
    if (ret == true) {
        return type;
    }

    return -1;
}
int get_uart_headset_type(void)
{
        unsigned int type = E_UART_HEADSET_TYPE_NOT_SUPPORTED;

        bool ret = get_hw_config_int("uart_headset/type", &type, NULL);
        HW_CONFIG_DEBUG("hsad: uart_headset_type = %d\n", type);
        if (ret == true) {
                return type;
        }

        return E_UART_HEADSET_TYPE_NOT_SUPPORTED;
}
int get_wifi_wl18xx_dcdc_config(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("wifi/wl1873_dcdc", &type, NULL);
	HW_CONFIG_DEBUG("hsad: wl1873_dcdc = %d\n", type);
	if (ret == true) {
		return type;
	}

	return -1;	
}
Exemple #14
0
int hsad_gyro_exist_info(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("sensor/gyro_exist_info", &type, NULL);
	HW_CONFIG_DEBUG("hsad: gyro_exist = %d,  ret = %d\n", type, ret);
	if (ret == true) {
		return type;
	}

	return -1;
}
int get_usbphy_tune(void)
{
	unsigned int value = 0;

	bool ret = get_hw_config_int("usbphy/usbphy_type", &value, NULL);
	HW_CONFIG_DEBUG("hsad: usbphy_type = %d,  ret = %d\n", value, ret);
	if (ret == true) {
		return value;
	}

	return -1;
}
int get_board_type(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("board/board_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: board_type = %d\n,  ret = %d", type, ret);
	if (ret == true) {
		return type;
	}

	return -1;
}
int get_sd_detect_type(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("board/sd_detect_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: sd_detect_type = %d, ret = %d\n", type, ret);
	if (ret == true) {
		return type;
	}

	return GPIO_HIGH_MEAN_DETECTED;
}
int get_sensor_timing_type(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("camera/camera_timing_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: camera_timing_type = %d,  ret = %d\n", type, ret);
	if (ret == true) {
		return type;
	}

	return -1;
}
int get_sensor_tp_type(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("sensor_v4/sensor_tp_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: sensor_tp_type = %d\n", type);
	if (ret == true) {
		return type;
	}

	return -1;
}
int get_secondary_sensor_flip_type(void)
{
        unsigned int type = E_CAMERA_SENSOR_FLIP_TYPE_H_V;

        bool ret = get_hw_config_int("camera/secondary_sensor_flip_type", &type, NULL);
        HW_CONFIG_DEBUG("hsad: secondary_sensor_flip_type = %d\n", type);
        if (ret == true) {
                return type;
        }

        return E_CAMERA_SENSOR_FLIP_TYPE_H_V;
}
int get_touchscreen_type(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("touchscreen/touchscreen_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: touchscreen_type = %d, ret = %d\n", type, ret);
	if (ret == true) {
		return type;
	}

	return -1;
}
/*gpio request by name*/
int gpio_request_by_name(char *name)
{
    int gpio_num = get_gpio_num_by_name(name);

    if(-1 == gpio_num)
    {
       HW_CONFIG_DEBUG(" return NULL\n");
        return -1;
    }

    return gpio_request(gpio_num, name);
}
int get_u9700_ldo_ctrl(void)
{
    unsigned int type = 0;

    bool ret = get_hw_config_int("u9700_ldo/sleep_ctrl", &type, NULL);
    HW_CONFIG_DEBUG("hsad: get_u9700_ldo_sleep_ctrl = %d\n", type);
    if (ret == true) {
        return type;
    }

    return -1;
}
int get_hs_keys(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("audio/hs_keys", &type, NULL);
	HW_CONFIG_DEBUG("hsad: hs_keys = %d,  ret = %d\n", type, ret);
	if (ret == true) {
		return type;
	}

	return -1;
}
int get_audience_i2c_addr(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("audio/audience_addr", &type, NULL);
	HW_CONFIG_DEBUG("hsad: audience_addr = %d\n", type);
	if (ret == true) {
		return type;
	}

	return -1;
}
int get_gpu_dcdc_supply(void)
{
	unsigned int supply = 0;

	bool ret = get_hw_config_int("gpu/gpu_dcdc_supply", &supply, NULL);
	HW_CONFIG_DEBUG("hsad: gpu_dcdc_supply = %d\n", supply);
	if (ret == true) {
		return supply;
	} else {
        return 0;
    }
}
Exemple #27
0
int hsad_compass_softiron_type(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("sensor/compass_softiron_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: compass_softiron_type = %d,  ret = %d\n", type, ret);
	if (ret == true) {
		return type;
	}

	return -1;
}
int get_felica_board_type(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("felica/board_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: felica_board_type = %d\n", type);
	if (ret == true) {
		return type;
	}

	return -1;
}
Exemple #29
0
int hsad_apds_get_type(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("apds/apds_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: apds_type = %d,  ret = %d\n", type, ret);
	if (ret == true) {
		return type;
	}

	return -1;
}
int get_motor_board_type(void)
{
	unsigned int type = 0;

	bool ret = get_hw_config_int("audio/motor_type", &type, NULL);
	HW_CONFIG_DEBUG("hsad: motor_type = %d\n", type);
	if (ret == true) {
		return type;
	}

	return -1;
}