Rajakumar Govindaram | 7d2b977 | 2017-07-19 15:16:12 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2017, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef _CAM_JPEG_CONTEXT_H_ |
| 14 | #define _CAM_JPEG_CONTEXT_H_ |
| 15 | |
| 16 | #include <uapi/media/cam_jpeg.h> |
| 17 | |
| 18 | #include "cam_context.h" |
| 19 | #include "cam_jpeg_hw_mgr_intf.h" |
| 20 | |
| 21 | #define CAM_JPEG_HW_EVENT_MAX 20 |
| 22 | |
| 23 | /** |
| 24 | * struct cam_jpeg_context - Jpeg context |
| 25 | * @base: Base jpeg cam context object |
| 26 | * @req_base: Common request structure |
| 27 | */ |
| 28 | struct cam_jpeg_context { |
| 29 | struct cam_context *base; |
| 30 | struct cam_ctx_request req_base[CAM_CTX_REQ_MAX]; |
| 31 | }; |
| 32 | |
| 33 | /* cam jpeg context irq handling function type */ |
| 34 | typedef int (*cam_jpeg_hw_event_cb_func)( |
| 35 | struct cam_jpeg_context *ctx_jpeg, |
| 36 | void *evt_data); |
| 37 | |
| 38 | /** |
| 39 | * struct cam_jpeg_ctx_irq_ops - Function table for handling IRQ callbacks |
| 40 | * |
| 41 | * @irq_ops: Array of handle function pointers. |
| 42 | * |
| 43 | */ |
| 44 | struct cam_jpeg_ctx_irq_ops { |
| 45 | cam_jpeg_hw_event_cb_func irq_ops[CAM_JPEG_HW_EVENT_MAX]; |
| 46 | }; |
| 47 | |
| 48 | /** |
| 49 | * cam_jpeg_context_init() |
| 50 | * |
| 51 | * @brief: Initialization function for the JPEG context |
| 52 | * |
| 53 | * @ctx: JPEG context obj to be initialized |
| 54 | * @ctx_base: Context base from cam_context |
| 55 | * @hw_intf: JPEG hw manager interface |
| 56 | * |
| 57 | */ |
| 58 | int cam_jpeg_context_init(struct cam_jpeg_context *ctx, |
| 59 | struct cam_context *ctx_base, |
| 60 | struct cam_hw_mgr_intf *hw_intf); |
| 61 | |
| 62 | /** |
| 63 | * cam_jpeg_context_deinit() |
| 64 | * |
| 65 | * @brief: Deinitialize function for the JPEG context |
| 66 | * |
| 67 | * @ctx: JPEG context obj to be deinitialized |
| 68 | * |
| 69 | */ |
| 70 | int cam_jpeg_context_deinit(struct cam_jpeg_context *ctx); |
| 71 | |
| 72 | #endif /* __CAM_JPEG_CONTEXT_H__ */ |