Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame^] | 1 | /* Copyright (c) 2015-2016, 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 _SDE_HW_WB_H |
| 14 | #define _SDE_HW_WB_H |
| 15 | |
| 16 | #include "sde_hw_catalog.h" |
| 17 | #include "sde_hw_mdss.h" |
| 18 | #include "sde_hw_mdp_util.h" |
| 19 | |
| 20 | struct sde_hw_wb; |
| 21 | |
| 22 | struct sde_hw_wb_cfg { |
| 23 | struct sde_hw_source_info dest; |
| 24 | }; |
| 25 | |
| 26 | /** |
| 27 | * |
| 28 | * struct sde_hw_wb_ops : Interface to the wb Hw driver functions |
| 29 | * Assumption is these functions will be called after clocks are enabled |
| 30 | */ |
| 31 | struct sde_hw_wb_ops { |
| 32 | void (*setup_csc_data)(struct sde_hw_wb *ctx, |
| 33 | struct sde_csc_cfg *data); |
| 34 | |
| 35 | void (*setup_outaddress)(struct sde_hw_wb *ctx, |
| 36 | struct sde_hw_wb_cfg *wb); |
| 37 | |
| 38 | void (*setup_outformat)(struct sde_hw_wb *ctx, |
| 39 | struct sde_hw_wb_cfg *wb); |
| 40 | |
| 41 | void (*setup_rotator)(struct sde_hw_wb *ctx, |
| 42 | struct sde_hw_wb_cfg *wb); |
| 43 | |
| 44 | void (*setup_dither)(struct sde_hw_wb *ctx, |
| 45 | struct sde_hw_wb_cfg *wb); |
| 46 | |
| 47 | void (*setup_cdwn)(struct sde_hw_wb *ctx, |
| 48 | struct sde_hw_wb_cfg *wb); |
| 49 | |
| 50 | void (*setup_trafficshaper)(struct sde_hw_wb *ctx, |
| 51 | struct sde_hw_wb_cfg *wb); |
| 52 | }; |
| 53 | |
| 54 | /** |
| 55 | * struct sde_hw_wb : WB driver object |
| 56 | * @struct sde_hw_blk_reg_map *hw; |
| 57 | * @idx |
| 58 | * @wb_hw_caps |
| 59 | * @mixer_hw_caps |
| 60 | * @ops |
| 61 | */ |
| 62 | struct sde_hw_wb { |
| 63 | /* base */ |
| 64 | struct sde_hw_blk_reg_map hw; |
| 65 | |
| 66 | /* wb path */ |
| 67 | int idx; |
| 68 | const struct sde_wb_cfg *caps; |
| 69 | |
| 70 | /* ops */ |
| 71 | struct sde_hw_wb_ops ops; |
| 72 | }; |
| 73 | |
| 74 | /** |
| 75 | * sde_hw_wb_init(): Initializes the wb_path hw driver object. |
| 76 | * should be called before accessing every mixer. |
| 77 | * @idx: wb_path index for which driver object is required |
| 78 | * @addr: mapped register io address of MDP |
| 79 | * @m : pointer to mdss catalog data |
| 80 | */ |
| 81 | struct sde_hw_wb *sde_hw_wb_init(enum sde_wb idx, |
| 82 | void __iomem *addr, |
| 83 | struct sde_mdss_cfg *m); |
| 84 | |
| 85 | #endif /*_SDE_HW_WB_H */ |