platform_max3111.c 936 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * platform_max3111.c: max3111 platform data initilization file
  3. *
  4. * (C) Copyright 2013 Intel Corporation
  5. * Author: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; version 2
  10. * of the License.
  11. */
  12. #include <linux/gpio.h>
  13. #include <linux/spi/spi.h>
  14. #include <asm/intel-mid.h>
  15. static void __init *max3111_platform_data(void *info)
  16. {
  17. struct spi_board_info *spi_info = info;
  18. int intr = get_gpio_by_name("max3111_int");
  19. spi_info->mode = SPI_MODE_0;
  20. if (intr == -1)
  21. return NULL;
  22. spi_info->irq = intr + INTEL_MID_IRQ_OFFSET;
  23. return NULL;
  24. }
  25. static const struct devs_id max3111_dev_id __initconst = {
  26. .name = "spi_max3111",
  27. .type = SFI_DEV_TYPE_SPI,
  28. .get_platform_data = &max3111_platform_data,
  29. };
  30. sfi_device(max3111_dev_id);