* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock: hwspinlock: add MAINTAINERS entries hwspinlock/omap: omap_hwspinlock_remove should be __devexit hwspinlock/u8500: add hwspinlock driver hwspinlock/core: register a bank of hwspinlocks in a single API call hwspinlock/core: remove stubs for register/unregister hwspinlock/core: use a mutex to protect the radix tree hwspinlock/core/omap: fix id issues on multiple hwspinlock devices hwspinlock/omap: simplify allocation scheme hwspinlock/core: simplify 'owner' handling hwspinlock/core: simplify Kconfig Fix up trivial conflicts (addition of omap_hwspinlock_pdata, removal of omap_spinlock_latency) in arch/arm/mach-omap2/hwspinlock.c Also, do an "evil merge" to fix a compile error in omap_hsmmc.c which for some reason was reported in the same email thread as the "please pull hwspinlock changes".
Showing the changes to include/linux (1 of 11 files). Show all
Unified · Split
| @@ -20,17 +20,49 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | #include <linux/err.h> |
| 22 | 22 | #include <linux/sched.h> |
| 23 | +#include <linux/device.h> | |
| 23 | 24 | |
| 24 | 25 | /* hwspinlock mode argument */ |
| 25 | 26 | #define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */ |
| 26 | 27 | #define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */ |
| 27 | 28 | |
| 28 | 29 | struct hwspinlock; |
| 30 | +struct hwspinlock_device; | |
| 31 | +struct hwspinlock_ops; | |
| 32 | + | |
| 33 | +/** | |
| 34 | + * struct hwspinlock_pdata - platform data for hwspinlock drivers | |
| 35 | + * @base_id: base id for this hwspinlock device | |
| 36 | + * | |
| 37 | + * hwspinlock devices provide system-wide hardware locks that are used | |
| 38 | + * by remote processors that have no other way to achieve synchronization. | |
| 39 | + * | |
| 40 | + * To achieve that, each physical lock must have a system-wide id number | |
| 41 | + * that is agreed upon, otherwise remote processors can't possibly assume | |
| 42 | + * they're using the same hardware lock. | |
| 43 | + * | |
| 44 | + * Usually boards have a single hwspinlock device, which provides several | |
| 45 | + * hwspinlocks, and in this case, they can be trivially numbered 0 to | |
| 46 | + * (num-of-locks - 1). | |
| 47 | + * | |
| 48 | + * In case boards have several hwspinlocks devices, a different base id | |
| 49 | + * should be used for each hwspinlock device (they can't all use 0 as | |
| 50 | + * a starting id!). | |
| 51 | + * | |
| 52 | + * This platform data structure should be used to provide the base id | |
| 53 | + * for each device (which is trivially 0 when only a single hwspinlock | |
| 54 | + * device exists). It can be shared between different platforms, hence | |
| 55 | + * its location. | |
| 56 | + */ | |
| 57 | +struct hwspinlock_pdata { | |
| 58 | + int base_id; | |
| 59 | +}; | |
| 29 | 60 | |
| 30 | 61 | #if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE) |
| 31 | 62 | |
| 32 | −int hwspin_lock_register(struct hwspinlock *lock); | |
| 33 | −struct hwspinlock *hwspin_lock_unregister(unsigned int id); | |
| 63 | +int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev, | |
| 64 | + const struct hwspinlock_ops *ops, int base_id, int num_locks); | |
| 65 | +int hwspin_lock_unregister(struct hwspinlock_device *bank); | |
| 34 | 66 | struct hwspinlock *hwspin_lock_request(void); |
| 35 | 67 | struct hwspinlock *hwspin_lock_request_specific(unsigned int id); |
| 36 | 68 | int hwspin_lock_free(struct hwspinlock *hwlock); |
| @@ -94,16 +126,6 @@ static inline int hwspin_lock_get_id(struct hwspinlock *hwlock) · 57 unmodified lines | ||
| 94 | 126 | return 0; |
| 95 | 127 | } |
| 96 | 128 | |
| 97 | −static inline int hwspin_lock_register(struct hwspinlock *hwlock) | |
| 98 | −{ | |
| 99 | − return -ENODEV; | |
| 100 | −} | |
| 101 | − | |
| 102 | −static inline struct hwspinlock *hwspin_lock_unregister(unsigned int id) | |
| 103 | −{ | |
| 104 | − return NULL; | |
| 105 | −} | |
| 106 | − | |
| 107 | 129 | #endif /* !CONFIG_HWSPINLOCK */ |
| 108 | 130 | |
| 109 | 131 | /** |