diff options
Diffstat (limited to 'drivers/misc/aspeed-lpc-ctrl.c')
-rw-r--r-- | drivers/misc/aspeed-lpc-ctrl.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/misc/aspeed-lpc-ctrl.c b/drivers/misc/aspeed-lpc-ctrl.c index 1827b7aa6674..a024f8042259 100644 --- a/drivers/misc/aspeed-lpc-ctrl.c +++ b/drivers/misc/aspeed-lpc-ctrl.c | |||
@@ -21,6 +21,10 @@ | |||
21 | 21 | ||
22 | #define DEVICE_NAME "aspeed-lpc-ctrl" | 22 | #define DEVICE_NAME "aspeed-lpc-ctrl" |
23 | 23 | ||
24 | #define HICR5 0x0 | ||
25 | #define HICR5_ENL2H BIT(8) | ||
26 | #define HICR5_ENFWH BIT(10) | ||
27 | |||
24 | #define HICR7 0x8 | 28 | #define HICR7 0x8 |
25 | #define HICR8 0xc | 29 | #define HICR8 0xc |
26 | 30 | ||
@@ -155,8 +159,18 @@ static long aspeed_lpc_ctrl_ioctl(struct file *file, unsigned int cmd, | |||
155 | if (rc) | 159 | if (rc) |
156 | return rc; | 160 | return rc; |
157 | 161 | ||
158 | return regmap_write(lpc_ctrl->regmap, HICR8, | 162 | rc = regmap_write(lpc_ctrl->regmap, HICR8, |
159 | (~(map.size - 1)) | ((map.size >> 16) - 1)); | 163 | (~(map.size - 1)) | ((map.size >> 16) - 1)); |
164 | if (rc) | ||
165 | return rc; | ||
166 | |||
167 | /* | ||
168 | * Enable LPC FHW cycles. This is required for the host to | ||
169 | * access the regions specified. | ||
170 | */ | ||
171 | return regmap_update_bits(lpc_ctrl->regmap, HICR5, | ||
172 | HICR5_ENFWH | HICR5_ENL2H, | ||
173 | HICR5_ENFWH | HICR5_ENL2H); | ||
160 | } | 174 | } |
161 | 175 | ||
162 | return -EINVAL; | 176 | return -EINVAL; |