/** * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * This source file is released under GPL v2 license (no other versions). * See the COPYING file included in the main directory of this source * distribution for the license terms and conditions. * * @File ctresource.h * * @Brief * This file contains the definition of generic hardware resources for * resource management. * * @Author Liu Chun * @Date May 13 2008 * */ #ifndef CTRESOURCE_H #define CTRESOURCE_H #include enum RSCTYP { SRC, SRCIMP, AMIXER, SUM, DAIO, NUM_RSCTYP /* This must be the last one and less than 16 */ }; struct rsc_ops; struct rsc { u32 idx:12; /* The index of a resource */ u32 type:4; /* The type (RSCTYP) of a resource */ u32 conj:12; /* Current conjugate index */ u32 msr:4; /* The Master Sample Rate a resource working on */ void *ctrl_blk; /* Chip specific control info block for a resource */ struct hw *hw; /* Chip specific object for hardware access means */ const struct rsc_ops *ops; /* Generic resource operations */ }; struct rsc_ops { int (*master)(struct rsc *rsc); /* Move to master resource */ int (*next_conj)(struct rsc *rsc); /* Move to next conjugate resource */ int (*index)(const struct rsc *rsc); /* Return the index of resource */ /* Return the output slot number */ int (*output_slot)(const struct rsc *rsc); }; int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw); int rsc_uninit(struct rsc *rsc); struct rsc_mgr { enum RSCTYP type; /* The type (RSCTYP) of resource to manage */ unsigned int amount; /* The total amount of a kind of resource */ unsigned int avail; /* The amount of currently available resources */ unsigned char *rscs; /* The bit-map for resource allocation */ void *ctrl_blk; /* Chip specific control info block */ struct hw *hw; /* Chip specific object for hardware access */ }; /* Resource management is based on bit-map mechanism */ int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, unsigned int amount, struct hw *hw); int rsc_mgr_uninit(struct rsc_mgr *mgr); int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx); int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx); #endif /* CTRESOURCE_H */ method='get' action='/cgit.cgi/linux/net-next.git/log/include/dt-bindings/clock/r8a7743-cpg-mssr.h'>
path: root/include/dt-bindings/clock/r8a7743-cpg-mssr.h
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-01-30 11:26:38 +0100
committerJiri Kosina <jkosina@suse.cz>2017-01-31 12:59:32 +0100
commit7a7b5df84b6b4e5d599c7289526eed96541a0654 (patch)
treecf7514c7ddf4410fe37ca9099a2785e1cf08fa7d /include/dt-bindings/clock/r8a7743-cpg-mssr.h
parent877a021e08ccb6434718c0cc781fdf943c884cc0 (diff)
HID: cp2112: fix sleep-while-atomic
A recent commit fixing DMA-buffers on stack added a shared transfer buffer protected by a spinlock. This is broken as the USB HID request callbacks can sleep. Fix this up by replacing the spinlock with a mutex. Fixes: 1ffb3c40ffb5 ("HID: cp2112: make transfer buffers DMA capable") Cc: stable <stable@vger.kernel.org> # 4.9 Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/dt-bindings/clock/r8a7743-cpg-mssr.h')