dev-hwmon.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* linux/arch/arm/plat-samsung/dev-hwmon.c
  2. *
  3. * Copyright 2008 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. * http://armlinux.simtec.co.uk/
  6. *
  7. * Adapted for HWMON by Maurus Cuelenaere
  8. *
  9. * Samsung series device definition for HWMON
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/platform_device.h>
  17. #include <plat/devs.h>
  18. #include <plat/hwmon.h>
  19. struct platform_device s3c_device_hwmon = {
  20. .name = "s3c-hwmon",
  21. .id = -1,
  22. .dev.parent = &s3c_device_adc.dev,
  23. };
  24. void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)
  25. {
  26. struct s3c_hwmon_pdata *npd;
  27. if (!pd) {
  28. printk(KERN_ERR "%s: no platform data\n", __func__);
  29. return;
  30. }
  31. npd = kmemdup(pd, sizeof(struct s3c_hwmon_pdata), GFP_KERNEL);
  32. if (!npd)
  33. printk(KERN_ERR "%s: no memory for platform data\n", __func__);
  34. s3c_device_hwmon.dev.platform_data = npd;
  35. }