ese_reset.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /******************************************************************************
  2. *
  3. * Copyright 2023 NXP Semiconductors
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. *
  19. ******************************************************************************/
  20. #ifndef _ESE_RESET_H_
  21. #define _ESE_RESET_H_
  22. #include <linux/ktime.h>
  23. #include <linux/kernel.h>
  24. #include <linux/module.h>
  25. #include <linux/delay.h>
  26. #include <linux/gpio.h>
  27. #include "p73.h"
  28. /*!
  29. * \brief Delay time required for ese reset by gpio
  30. */
  31. #define ESE_GPIO_RESET_WAIT_TIME_USEC (12000)
  32. /*!
  33. * \brief Guard time delay to prevent back to back gpio reset requests
  34. */
  35. #define ESE_GPIO_RST_GUARD_TIME_MS (50)
  36. /*!
  37. * \brief Argument values to be passed to ioctl call
  38. */
  39. #define ESE_SOFT_RESET (1UL)
  40. #define ESE_HARD_RESET (2UL)
  41. #define ESE_DOMAIN_RESET (5UL)
  42. /*!
  43. * \brief To denote gpio reset currently in progress
  44. */
  45. typedef struct reset_timer {
  46. int rst_gpio;
  47. bool in_progress;
  48. struct mutex reset_mutex;
  49. struct timer_list timer;
  50. } reset_timer_t;
  51. void ese_reset_init(void);
  52. int perform_ese_gpio_reset(int rst_gpio);
  53. void ese_reset_deinit(void);
  54. int ese_reset_gpio_setup(struct p61_spi_platform_data *data);
  55. #endif