i2c-isa.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. i2c-isa.c - Part of lm_sensors, Linux kernel modules for hardware
  3. monitoring
  4. Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
  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. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. /* This implements an i2c algorithm/adapter for ISA bus. Not that this is
  18. on first sight very useful; almost no functionality is preserved.
  19. Except that it makes writing drivers for chips which can be on both
  20. the SMBus and the ISA bus very much easier. See lm78.c for an example
  21. of this. */
  22. #include <linux/init.h>
  23. #include <linux/module.h>
  24. #include <linux/kernel.h>
  25. #include <linux/errno.h>
  26. #include <linux/i2c.h>
  27. static u32 isa_func(struct i2c_adapter *adapter);
  28. /* This is the actual algorithm we define */
  29. static struct i2c_algorithm isa_algorithm = {
  30. .name = "ISA bus algorithm",
  31. .id = I2C_ALGO_ISA,
  32. .functionality = isa_func,
  33. };
  34. /* There can only be one... */
  35. static struct i2c_adapter isa_adapter = {
  36. .owner = THIS_MODULE,
  37. .class = I2C_CLASS_HWMON,
  38. .algo = &isa_algorithm,
  39. .name = "ISA main adapter",
  40. };
  41. /* We can't do a thing... */
  42. static u32 isa_func(struct i2c_adapter *adapter)
  43. {
  44. return 0;
  45. }
  46. static int __init i2c_isa_init(void)
  47. {
  48. return i2c_add_adapter(&isa_adapter);
  49. }
  50. static void __exit i2c_isa_exit(void)
  51. {
  52. i2c_del_adapter(&isa_adapter);
  53. }
  54. MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>");
  55. MODULE_DESCRIPTION("ISA bus access through i2c");
  56. MODULE_LICENSE("GPL");
  57. module_init(i2c_isa_init);
  58. module_exit(i2c_isa_exit);