fingerprint_common.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef _FINGERPRINT_COMMON_H_
  2. #define _FINGERPRINT_COMMON_H_
  3. #include "fingerprint.h"
  4. #include <linux/pm_qos.h>
  5. #include <linux/delay.h>
  6. #include <linux/pm_wakeup.h>
  7. #include <linux/clk.h>
  8. #include <linux/spi/spi.h>
  9. #include <linux/workqueue.h>
  10. #include <linux/timer.h>
  11. #include <linux/version.h>
  12. #define DEBUG_TIMER_SEC (10 * HZ)
  13. struct boosting_config {
  14. unsigned int min_cpufreq_limit;
  15. struct pm_qos_request pm_qos;
  16. };
  17. struct spi_clk_setting {
  18. bool enabled_clk;
  19. u32 spi_speed;
  20. struct wakeup_source *spi_wake_lock;
  21. #ifdef ENABLE_SENSORS_FPRINT_SECURE
  22. struct clk *fp_spi_pclk;
  23. struct clk *fp_spi_sclk;
  24. #endif
  25. };
  26. struct debug_logger {
  27. struct work_struct work_debug;
  28. struct workqueue_struct *wq_dbg;
  29. struct timer_list dbg_timer;
  30. struct device *dev;
  31. };
  32. extern struct debug_logger *g_logger;
  33. void spi_get_ctrldata(struct spi_device *spi);
  34. void set_sensor_type(const int type_value, int *sensortype);
  35. int spi_clk_register(struct spi_clk_setting *clk_setting, struct device *dev);
  36. int spi_clk_unregister(struct spi_clk_setting *clk_setting);
  37. int spi_clk_enable(struct spi_clk_setting *clk_setting);
  38. int spi_clk_disable(struct spi_clk_setting *clk_setting);
  39. int cpu_speedup_enable(struct boosting_config *boosting);
  40. int cpu_speedup_disable(struct boosting_config *boosting);
  41. void enable_fp_debug_timer(struct debug_logger *logger);
  42. void disable_fp_debug_timer(struct debug_logger *logger);
  43. int set_fp_debug_timer(struct debug_logger *logger,
  44. void (*func)(struct work_struct *work));
  45. void set_delay_in_spi_transfer(struct spi_transfer *xfer, unsigned int usec);
  46. #endif /* _FINGERPRINT_COMMON_H_ */