1
0
Fork 0
remarkable-linux/drivers/misc/rm-otgcontrol/otgcontrol_onewire.h

27 lines
1.1 KiB
C

#ifndef __OTGCONTROL_ONE_WIRE_H__
#define __OTGCONTROL_ONE_WIRE_H__
#include <linux/rm-otgcontrol.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#define OTG1_ONEWIRE_STATE__GPIO 0
#define OTG1_ONEWIRE_STATE__UART_TX 1
#define OTG1_ONEWIRE_STATE__UART_RX 2
int otgcontrol_init_one_wire_mux_state(struct rm_otgcontrol_data *otgc_data);
void otgcontrol_uninit_onw_wire_mux_state(struct rm_otgcontrol_data *otgc_data);
int otgcontrol_switch_one_wire_mux_state(struct rm_otgcontrol_data *otgc_data, int newState);
int otgcontrol_get_current_gpio_state(struct rm_otgcontrol_data *otgc_data);
int otgcontrol_init_gpio_irq(struct rm_otgcontrol_data *otgc_data);
void otgcontrol_activate_gpio_irq(struct rm_otgcontrol_data *otgc_data);
void otgcontrol_deactivate_gpio_irq(struct rm_otgcontrol_data *otgc_data);
static irqreturn_t otgcontrol_gpio_irq_handler(int irq, void *data);
static void otgcontrol_gpio_irq_work(struct work_struct *work);
int otgcontrol_onewire_read_until_cr(char *device_name, char *buf, int maxlen);
int otgcontrol_onewire_write_tty(char *device_name, char *text_to_send);
#endif /* __OTGCONTROL_ONE_WIRE_H__ */