u32 omap_pmic_voltage_ramp_delay(u8 srid, u8 target_vsel, u8 current_vsel) { u32 cpcap_smps_steps, cpcap_smps_delay; u8 slave_addr = (srid == SR1) ? CPCAP_SRI2C_SLAVE_ADDR_VDD1 : CPCAP_SRI2C_SLAVE_ADDR_VDD2; u16 timeout = COUNT_TIMEOUT_VCBYPASS; int ret = -1; ret = vc_send_command(slave_addr, CPCAP_SMPS_VOL_OPP2, target_vsel, &timeout); if (target_vsel < current_vsel) return 0; cpcap_smps_steps = abs(target_vsel - current_vsel); cpcap_smps_delay = ((cpcap_smps_steps * 125) / 130) + 2; if (!ret) { if (cpcap_smps_delay > (COUNT_TIMEOUT_VCBYPASS - timeout)) cpcap_smps_delay -= (COUNT_TIMEOUT_VCBYPASS - timeout); else return 0; } return cpcap_smps_delay; }
int32_t vrs_send_node_destroy(const uint8_t session_id, const uint8_t prio, const uint32_t node_id) { struct Generic_Cmd *node_destroy_cmd = v_node_destroy_create(node_id); return vc_send_command(session_id, prio, node_destroy_cmd); }
int32_t vrs_send_taggroup_destroy(const uint8_t session_id, const uint8_t prio, const uint32_t node_id, const uint16_t taggroup_id) { struct Generic_Cmd *taggroup_destroy_cmd = v_taggroup_destroy_create(node_id, taggroup_id); return vc_send_command(session_id, prio, taggroup_destroy_cmd); }
int32_t vrs_send_node_link(const uint8_t session_id, const uint8_t prio, const uint32_t parent_node_id, const uint32_t child_node_id) { struct Generic_Cmd *node_link_cmd = v_node_link_create(parent_node_id, child_node_id); return vc_send_command(session_id, prio, node_link_cmd); }
int32_t vrs_send_node_owner(const uint8_t session_id, const uint8_t prio, uint32_t node_id, uint16_t user_id) { struct Generic_Cmd *node_owner_cmd = v_node_owner_create(node_id, user_id); return vc_send_command(session_id, prio, node_owner_cmd); }
int32_t vrs_send_node_unsubscribe(const uint8_t session_id, const uint8_t prio, const uint32_t node_id, const uint8_t versing) { struct Generic_Cmd *node_unsubscribe_cmd = v_node_unsubscribe_create(node_id, 0, versing); return vc_send_command(session_id, prio, node_unsubscribe_cmd); }
/* VCBypass mode for CPCAP chip. */ int omap_pmic_voltage_cmds(u8 srid, u8 target_vsel) { u8 slave_addr = (srid == SR1) ? CPCAP_SRI2C_SLAVE_ADDR_VDD1 : CPCAP_SRI2C_SLAVE_ADDR_VDD2; u16 timeout = COUNT_TIMEOUT_VCBYPASS; return vc_send_command(slave_addr, CPCAP_SRI2C_VDD_CONTROL, target_vsel, &timeout); }
int32_t vrs_send_layer_unset_value(const uint8_t session_id, const uint8_t prio, const uint32_t node_id, const uint16_t layer_id, const uint32_t item_id) { struct Generic_Cmd *layer_unset_value_cmd = v_layer_unset_value_create(node_id, layer_id, item_id); return vc_send_command(session_id, prio, layer_unset_value_cmd); }
int32_t vrs_send_layer_subscribe(const uint8_t session_id, const uint8_t prio, const uint32_t node_id, const uint16_t layer_id, const uint32_t version, const uint32_t crc32) { struct Generic_Cmd *layer_subscribe_cmd = v_layer_subscribe_create(node_id, layer_id, version, crc32); return vc_send_command(session_id, prio, layer_subscribe_cmd); }
int32_t vrs_send_taggroup_subscribe(const uint8_t session_id, const uint8_t prio, const uint32_t node_id, const uint16_t taggroup_id, const uint32_t version, const uint32_t crc32) { struct Generic_Cmd *taggroup_subscribe_cmd = v_taggroup_subscribe_create(node_id, taggroup_id, version, crc32); return vc_send_command(session_id, prio, taggroup_subscribe_cmd); }
int32_t vrs_send_fps(const uint8_t session_id, const uint8_t prio, const float fps) { struct Generic_Cmd *fps_cmd; struct timeval tv; gettimeofday(&tv, NULL); fps_cmd = v_fps_create(fps, tv.tv_sec, tv.tv_usec); return vc_send_command(session_id, prio, fps_cmd); }
int32_t vrs_send_user_authenticate(const uint8_t session_id, const char *username, const uint8_t auth_type, const char *data) { struct User_Authenticate_Cmd *user_auth; uint8 methods[1]; methods[0] = auth_type; user_auth = v_user_auth_create(username, 1, methods, data); return vc_send_command(session_id, VRS_DEFAULT_PRIORITY, (struct Generic_Cmd*)user_auth); }
int32_t vrs_send_layer_create(const uint8_t session_id, const uint8_t prio, const uint32_t node_id, const uint16_t parent_layer_id, const uint8_t data_type, const uint8_t count, const uint16_t type) { struct Generic_Cmd *layer_create_cmd = v_layer_create_create(node_id, parent_layer_id, 0xFFFF, data_type, count, type); return vc_send_command(session_id, prio, layer_create_cmd); }
int32_t vrs_send_tag_create(const uint8_t session_id, const uint8_t prio, const uint32_t node_id, const uint16_t taggroup_id, const uint8_t data_type, const uint8_t count, const uint16_t type) { struct Generic_Cmd *tag_create_cmd = v_tag_create_create(node_id, taggroup_id, -1, data_type, count, type); return vc_send_command(session_id, prio, tag_create_cmd); }
int32_t vrs_send_connect_terminate(const uint8_t session_id) { struct Connect_Terminate_Cmd *conn_term; conn_term = v_connect_terminate_create(0); return vc_send_command(session_id, VRS_DEFAULT_PRIORITY, (struct Generic_Cmd*)conn_term); }