| .. | .. |
|---|
| 10 | 10 | ZLIB_MOD, |
|---|
| 11 | 11 | }; |
|---|
| 12 | 12 | |
|---|
| 13 | +/* The high 16 bits indicate whether decompression is non-blocking */ |
|---|
| 14 | +#define DECOM_NOBLOCKING (0x00010000) |
|---|
| 15 | + |
|---|
| 16 | +static inline u32 rk_get_decom_mode(u32 mode) |
|---|
| 17 | +{ |
|---|
| 18 | + return mode & 0x0000ffff; |
|---|
| 19 | +} |
|---|
| 20 | + |
|---|
| 21 | +static inline bool rk_get_noblocking_flag(u32 mode) |
|---|
| 22 | +{ |
|---|
| 23 | + return !!(mode & DECOM_NOBLOCKING); |
|---|
| 24 | +} |
|---|
| 25 | + |
|---|
| 13 | 26 | #ifdef CONFIG_ROCKCHIP_HW_DECOMPRESS |
|---|
| 14 | 27 | int rk_decom_start(u32 mode, phys_addr_t src, phys_addr_t dst, u32 dst_max_size); |
|---|
| 28 | +/* timeout in seconds */ |
|---|
| 29 | +int rk_decom_wait_done(u32 timeout, u64 *decom_len); |
|---|
| 15 | 30 | #else |
|---|
| 16 | 31 | static inline int rk_decom_start(u32 mode, phys_addr_t src, phys_addr_t dst, u32 dst_max_size) |
|---|
| 17 | 32 | { |
|---|
| 18 | 33 | return -EINVAL; |
|---|
| 19 | 34 | } |
|---|
| 35 | + |
|---|
| 36 | +static inline int rk_decom_wait_done(u32 timeout, u64 *decom_len) |
|---|
| 37 | +{ |
|---|
| 38 | + return -EINVAL; |
|---|
| 39 | +} |
|---|
| 20 | 40 | #endif |
|---|
| 21 | 41 | |
|---|
| 22 | 42 | #endif |
|---|