static int tps65910_gpio_input(struct gpio_chip *gc, unsigned offset)
{
	struct tps65910 *tps65910 = container_of(gc, struct tps65910, gpio);

	return tps65910_clear_bits(tps65910, TPS65910_GPIO0 + offset,
						GPIO_CFG_MASK);
}
Esempio n. 2
0
static int tps65910_rtc_stop_alarm(struct tps65910_rtc *tps65910_rtc)
{
	tps65910_rtc->alarm_enabled = 0;

	return tps65910_clear_bits(tps65910_rtc->tps65910, TPS65910_RTC_INTERRUPTS,
			       BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);

}
Esempio n. 3
0
static int tps65910_rtc_update_irq_enable(struct device *dev,
				       unsigned int enabled)
{
	struct tps65910_rtc *tps65910_rtc = dev_get_drvdata(dev);

	if (enabled)
		return tps65910_set_bits(tps65910_rtc->tps65910, TPS65910_RTC_INTERRUPTS,
			       BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
	else
		return tps65910_clear_bits(tps65910_rtc->tps65910, TPS65910_RTC_INTERRUPTS,
			       BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
}
static void tps65910_gpio_set(struct gpio_chip *gc, unsigned offset,
			      int value)
{
	struct tps65910 *tps65910 = container_of(gc, struct tps65910, gpio);

	if (value)
		tps65910_set_bits(tps65910, TPS65910_GPIO0 + offset,
						GPIO_SET_MASK);
	else
		tps65910_clear_bits(tps65910, TPS65910_GPIO0 + offset,
						GPIO_SET_MASK);
}