예제 #1
0
static int qpnp_wled_set_display_type(struct qpnp_wled *wled, uint16_t base_addr)
{
	uint8_t reg = 0;
	int rc;

	/* display type */
	reg = pm8x41_wled_reg_read(QPNP_WLED_DISP_SEL_REG(base_addr));

	reg &= QPNP_WLED_DISP_SEL_MASK;
	reg |= (wled->disp_type_amoled << QPNP_WLED_DISP_SEL_SHIFT);

	rc = qpnp_wled_sec_access(wled, base_addr);
	if (rc)
		return rc;

	pm8x41_wled_reg_write(QPNP_WLED_DISP_SEL_REG(base_addr), reg);

	return 0;
}
예제 #2
0
파일: leds-qpnp-wled.c 프로젝트: qriozum/M9
static int qpnp_wled_set_disp(struct qpnp_wled *wled, u16 base_addr)
{
	int rc;
	u8 reg;

	/* display type */
	rc = qpnp_wled_read_reg(wled, &reg,
			QPNP_WLED_DISP_SEL_REG(base_addr));
	if (rc < 0)
		return rc;

	reg &= QPNP_WLED_DISP_SEL_MASK;
	reg |= (wled->disp_type_amoled << QPNP_WLED_DISP_SEL_SHIFT);
	rc = qpnp_wled_write_reg(wled, &reg,
			QPNP_WLED_DISP_SEL_REG(base_addr));
	if (rc)
		return rc;

	return 0;
}