sysfs.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * linux/drivers/mmc/core/sysfs.h
  3. *
  4. * Copyright (C) 2003 Russell King, All Rights Reserved.
  5. * Copyright 2007 Pierre Ossman
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _MMC_CORE_SYSFS_H
  12. #define _MMC_CORE_SYSFS_H
  13. #define MMC_ATTR_FN(name, fmt, args...) \
  14. static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
  15. { \
  16. struct mmc_card *card = container_of(dev, struct mmc_card, dev);\
  17. return sprintf(buf, fmt, args); \
  18. }
  19. #define MMC_ATTR_RO(name) __ATTR(name, S_IRUGO, mmc_##name##_show, NULL)
  20. int mmc_add_attrs(struct mmc_card *card, struct device_attribute *attrs);
  21. void mmc_remove_attrs(struct mmc_card *card, struct device_attribute *attrs);
  22. struct mmc_host *mmc_alloc_host_sysfs(int extra, struct device *dev);
  23. int mmc_add_host_sysfs(struct mmc_host *host);
  24. void mmc_remove_host_sysfs(struct mmc_host *host);
  25. void mmc_free_host_sysfs(struct mmc_host *host);
  26. int mmc_schedule_work(struct work_struct *work);
  27. int mmc_schedule_delayed_work(struct delayed_work *work, unsigned long delay);
  28. void mmc_flush_scheduled_work(void);
  29. #endif