#include <linux/uaccess.h>
#include <linux/extcon.h>
#include <linux/cdev.h>
+#include <linux/poll.h>
+#include <linux/workqueue.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
}
EXPORT_SYMBOL(get_vout2_mode_internal);
+static inline void vout2_setmode_wakeup_queue(void)
+{
+ if (vout2_cdev)
+ wake_up(&vout2_cdev->setmode_queue);
+}
+
static int set_vout2_mode(char *name)
{
enum vmode_e mode;
vout2_notifier_call_chain(VOUT_EVENT_MODE_CHANGE, &mode);
extcon_set_state_sync(vout2_excton_setmode, EXTCON_TYPE_DISP, 0);
+ vout2_setmode_wakeup_queue();
return ret;
}
}
#endif
+static unsigned int vout2_poll(struct file *file, poll_table *wait)
+{
+ struct vout_cdev_s *vcdev = file->private_data;
+ unsigned int mask = 0;
+
+ poll_wait(file, &vcdev->setmode_queue, wait);
+ mask = (POLLIN | POLLRDNORM);
+
+ return mask;
+}
+
static const struct file_operations vout2_fops = {
.owner = THIS_MODULE,
.open = vout2_io_open,
#ifdef CONFIG_COMPAT
.compat_ioctl = vout2_compat_ioctl,
#endif
+ .poll = vout2_poll,
};
static int vout2_fops_create(void)
goto vout2_fops_err3;
}
+ init_waitqueue_head(&vout2_cdev->setmode_queue);
+
VOUTPR("vout2: %s OK\n", __func__);
return 0;
#include <linux/uaccess.h>
#include <linux/extcon.h>
#include <linux/cdev.h>
+#include <linux/poll.h>
+#include <linux/workqueue.h>
/* Amlogic Headers */
#include <linux/amlogic/media/vout/vout_notify.h>
}
EXPORT_SYMBOL(get_vout_mode_uboot);
+static inline void vout_setmode_wakeup_queue(void)
+{
+ if (tvout_monitor_flag)
+ return;
+
+ if (vout_cdev)
+ wake_up(&vout_cdev->setmode_queue);
+}
+
int set_vout_mode(char *name)
{
enum vmode_e mode;
vout_notifier_call_chain(VOUT_EVENT_MODE_CHANGE, &mode);
extcon_set_state_sync(vout_excton_setmode, EXTCON_TYPE_DISP, 0);
+ vout_setmode_wakeup_queue();
return ret;
}
}
#endif
+static unsigned int vout_poll(struct file *file, poll_table *wait)
+{
+ struct vout_cdev_s *vcdev = file->private_data;
+ unsigned int mask = 0;
+
+ poll_wait(file, &vcdev->setmode_queue, wait);
+ mask = (POLLIN | POLLRDNORM);
+
+ return mask;
+}
+
static const struct file_operations vout_fops = {
.owner = THIS_MODULE,
.open = vout_io_open,
#ifdef CONFIG_COMPAT
.compat_ioctl = vout_compat_ioctl,
#endif
+ .poll = vout_poll,
};
static int vout_fops_create(void)
goto vout_fops_err3;
}
+ init_waitqueue_head(&vout_cdev->setmode_queue);
+
VOUTPR("%s OK\n", __func__);
return 0;