aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/westbridge/astoria/device/cyasdevice.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/westbridge/astoria/device/cyasdevice.c')
-rw-r--r--drivers/staging/westbridge/astoria/device/cyasdevice.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/staging/westbridge/astoria/device/cyasdevice.c b/drivers/staging/westbridge/astoria/device/cyasdevice.c
index 9b5bc53c990..c76e3837501 100644
--- a/drivers/staging/westbridge/astoria/device/cyasdevice.c
+++ b/drivers/staging/westbridge/astoria/device/cyasdevice.c
@@ -48,6 +48,8 @@ typedef struct cyasdevice {
48 cy_as_device_handle dev_handle; 48 cy_as_device_handle dev_handle;
49 /* Handle to the HAL */ 49 /* Handle to the HAL */
50 cy_as_hal_device_tag hal_tag; 50 cy_as_hal_device_tag hal_tag;
51 spinlock_t common_lock;
52 unsigned long flags;
51} cyasdevice; 53} cyasdevice;
52 54
53/* global ptr to astoria device */ 55/* global ptr to astoria device */
@@ -126,6 +128,20 @@ static void cy_misc_callback(cy_as_device_handle h,
126 } 128 }
127} 129}
128 130
131void cy_as_acquire_common_lock()
132{
133 spin_lock_irqsave(&cy_as_device_controller->common_lock,
134 cy_as_device_controller->flags);
135}
136EXPORT_SYMBOL(cy_as_acquire_common_lock);
137
138void cy_as_release_common_lock()
139{
140 spin_unlock_irqrestore(&cy_as_device_controller->common_lock,
141 cy_as_device_controller->flags);
142}
143EXPORT_SYMBOL(cy_as_release_common_lock);
144
129/* reset astoria and reinit all regs */ 145/* reset astoria and reinit all regs */
130 #define PNAND_REG_CFG_INIT_VAL 0x0000 146 #define PNAND_REG_CFG_INIT_VAL 0x0000
131void hal_reset(cy_as_hal_device_tag tag) 147void hal_reset(cy_as_hal_device_tag tag)
@@ -331,6 +347,8 @@ static int cyasdevice_initialize(void)
331 ((ver_data.is_debug_mode) ? "debug" : "release"), 347 ((ver_data.is_debug_mode) ? "debug" : "release"),
332 ver_data.major, ver_data.minor, ver_data.build, str); 348 ver_data.major, ver_data.minor, ver_data.build, str);
333 349
350 spin_lock_init(&cy_as_dev->common_lock);
351
334 /* done now */ 352 /* done now */
335 cy_as_device_controller = cy_as_dev; 353 cy_as_device_controller = cy_as_dev;
336 354