예제 #1
0
static int m6_set_pullup(unsigned int pin,unsigned int config)
{
	unsigned int reg=0,bit=0,ret;
	u16 pullarg = AML_PINCONF_UNPACK_PULL_ARG(config);
	ret=amlogic_pin_to_pullup(pin,&reg,&bit);
	if(!ret)
	{
		if(pullarg)
			aml_set_reg32_mask(p_pull_up_addr[reg],1<<bit);
		else
			aml_clr_reg32_mask(p_pull_up_addr[reg],1<<bit);
	}
	return ret;
}
예제 #2
0
static int m6tv_set_pullup(unsigned int pin, unsigned int config)
{
	unsigned int reg = 0, bit = 0, ret;
	u16 pullarg = AML_PINCONF_UNPACK_PULL_ARG(config);

	if (m6tv_pull_up[pin] == PULL_UP_NONE)
		return -1;

	reg = PULL_UP_REG(m6tv_pull_up[pin]);
	bit = PULL_UP_BIT(m6tv_pull_up[pin]);

	if(pullarg)
		aml_set_reg32_mask(p_pull_up_addr[reg], 1<<bit);
	else
		aml_clr_reg32_mask(p_pull_up_addr[reg], 1<<bit);
	return 0;
}
예제 #3
0
int meson_config_pullup(unsigned int pin,
					struct meson_domain *domain,
					struct meson_bank *bank,
					unsigned int config)
{
	int ret;
	u16 pullarg = AML_PINCONF_UNPACK_PULL_ARG(config);
	u16 pullen = AML_PINCONF_UNPACK_PULL_EN(config);
	unsigned int reg, bit;
	meson_calc_reg_and_bit(bank, pin, REG_PULLEN,
				   &reg, &bit);
	ret = regmap_update_bits(domain->reg_pullen, reg,
				 BIT(bit), pullen ? BIT(bit) : 0);
	if (ret)
		return ret;

	meson_calc_reg_and_bit(bank, pin, REG_PULL, &reg, &bit);
	ret = regmap_update_bits(domain->reg_pull, reg,
				 BIT(bit), pullarg ? BIT(bit) : 0);
	return ret;

}