Release 4.11 drivers/staging/greybus/gbphy.h
/*
* Greybus Bridged-Phy Bus driver
*
* Copyright 2016 Google Inc.
*
* Released under the GPLv2 only.
*/
#ifndef __GBPHY_H
#define __GBPHY_H
struct gbphy_device {
u32 id;
struct greybus_descriptor_cport *cport_desc;
struct gb_bundle *bundle;
struct list_head list;
struct device dev;
};
#define to_gbphy_dev(d) container_of(d, struct gbphy_device, dev)
static inline void *gb_gbphy_get_data(struct gbphy_device *gdev)
{
return dev_get_drvdata(&gdev->dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Greg Kroah-Hartman | 20 | 90.91% | 1 | 50.00% |
Sandeep Patil | 2 | 9.09% | 1 | 50.00% |
Total | 22 | 100.00% | 2 | 100.00% |
static inline void gb_gbphy_set_data(struct gbphy_device *gdev, void *data)
{
dev_set_drvdata(&gdev->dev, data);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Greg Kroah-Hartman | 24 | 92.31% | 1 | 50.00% |
Sandeep Patil | 2 | 7.69% | 1 | 50.00% |
Total | 26 | 100.00% | 2 | 100.00% |
struct gbphy_device_id {
__u8 protocol_id;
};
#define GBPHY_PROTOCOL(p) \
.protocol_id = (p),
struct gbphy_driver {
const char *name;
int (*probe)(struct gbphy_device *,
const struct gbphy_device_id *id);
void (*remove)(struct gbphy_device *);
const struct gbphy_device_id *id_table;
struct device_driver driver;
};
#define to_gbphy_driver(d) container_of(d, struct gbphy_driver, driver)
int gb_gbphy_register_driver(struct gbphy_driver *driver,
struct module *owner, const char *mod_name);
void gb_gbphy_deregister_driver(struct gbphy_driver *driver);
#define gb_gbphy_register(driver) \
gb_gbphy_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
#define gb_gbphy_deregister(driver) \
gb_gbphy_deregister_driver(driver)
/**
* module_gbphy_driver() - Helper macro for registering a gbphy driver
* @__gbphy_driver: gbphy_driver structure
*
* Helper macro for gbphy drivers to set up proper module init / exit
* functions. Replaces module_init() and module_exit() and keeps people from
* printing pointless things to the kernel log when their driver is loaded.
*/
#define module_gbphy_driver(__gbphy_driver) \
module_driver(__gbphy_driver, gb_gbphy_register, gb_gbphy_deregister)
#ifdef CONFIG_PM
static inline int gbphy_runtime_get_sync(struct gbphy_device *gbphy_dev)
{
struct device *dev = &gbphy_dev->dev;
int ret;
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
dev_err(dev, "pm_runtime_get_sync failed: %d\n", ret);
pm_runtime_put_noidle(dev);
return ret;
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Lin | 60 | 100.00% | 1 | 100.00% |
Total | 60 | 100.00% | 1 | 100.00% |
static inline void gbphy_runtime_put_autosuspend(struct gbphy_device *gbphy_dev)
{
struct device *dev = &gbphy_dev->dev;
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Lin | 32 | 100.00% | 1 | 100.00% |
Total | 32 | 100.00% | 1 | 100.00% |
static inline void gbphy_runtime_get_noresume(struct gbphy_device *gbphy_dev)
{
pm_runtime_get_noresume(&gbphy_dev->dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Lin | 20 | 100.00% | 1 | 100.00% |
Total | 20 | 100.00% | 1 | 100.00% |
static inline void gbphy_runtime_put_noidle(struct gbphy_device *gbphy_dev)
{
pm_runtime_put_noidle(&gbphy_dev->dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Lin | 20 | 100.00% | 1 | 100.00% |
Total | 20 | 100.00% | 1 | 100.00% |
#else
static inline int gbphy_runtime_get_sync(struct gbphy_device *gbphy_dev) { return 0; }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Lin | 13 | 86.67% | 1 | 50.00% |
Axel Haslam | 2 | 13.33% | 1 | 50.00% |
Total | 15 | 100.00% | 2 | 100.00% |
static inline void gbphy_runtime_put_autosuspend(struct gbphy_device *gbphy_dev) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Lin | 9 | 81.82% | 1 | 50.00% |
Axel Haslam | 2 | 18.18% | 1 | 50.00% |
Total | 11 | 100.00% | 2 | 100.00% |
static inline void gbphy_runtime_get_noresume(struct gbphy_device *gbphy_dev) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Lin | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
static inline void gbphy_runtime_put_noidle(struct gbphy_device *gbphy_dev) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Lin | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
#endif
#endif /* __GBPHY_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Lin | 182 | 45.27% | 1 | 14.29% |
Greg Kroah-Hartman | 179 | 44.53% | 3 | 42.86% |
Sandeep Patil | 32 | 7.96% | 1 | 14.29% |
Viresh Kumar | 5 | 1.24% | 1 | 14.29% |
Axel Haslam | 4 | 1.00% | 1 | 14.29% |
Total | 402 | 100.00% | 7 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.