| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2012 Russell King |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 6 | | - * published by the Free Software Foundation. |
|---|
| 7 | 4 | */ |
|---|
| 8 | 5 | #ifndef ARMADA_CRTC_H |
|---|
| 9 | 6 | #define ARMADA_CRTC_H |
|---|
| 7 | + |
|---|
| 8 | +#include <drm/drm_crtc.h> |
|---|
| 10 | 9 | |
|---|
| 11 | 10 | struct armada_gem_object; |
|---|
| 12 | 11 | |
|---|
| .. | .. |
|---|
| 37 | 36 | struct armada_crtc { |
|---|
| 38 | 37 | struct drm_crtc crtc; |
|---|
| 39 | 38 | const struct armada_variant *variant; |
|---|
| 39 | + void *variant_data; |
|---|
| 40 | 40 | unsigned num; |
|---|
| 41 | 41 | void __iomem *base; |
|---|
| 42 | 42 | struct clk *clk; |
|---|
| 43 | | - struct clk *extclk[2]; |
|---|
| 44 | 43 | struct { |
|---|
| 45 | 44 | uint32_t spu_v_h_total; |
|---|
| 46 | 45 | uint32_t spu_v_porch; |
|---|
| .. | .. |
|---|
| 73 | 72 | |
|---|
| 74 | 73 | void armada_drm_crtc_update_regs(struct armada_crtc *, struct armada_regs *); |
|---|
| 75 | 74 | |
|---|
| 75 | +struct armada_clocking_params { |
|---|
| 76 | + unsigned long permillage_min; |
|---|
| 77 | + unsigned long permillage_max; |
|---|
| 78 | + u32 settable; |
|---|
| 79 | + u32 div_max; |
|---|
| 80 | +}; |
|---|
| 81 | + |
|---|
| 82 | +struct armada_clk_result { |
|---|
| 83 | + unsigned long desired_clk_hz; |
|---|
| 84 | + struct clk *clk; |
|---|
| 85 | + u32 div; |
|---|
| 86 | +}; |
|---|
| 87 | + |
|---|
| 88 | +int armada_crtc_select_clock(struct armada_crtc *dcrtc, |
|---|
| 89 | + struct armada_clk_result *res, |
|---|
| 90 | + const struct armada_clocking_params *params, |
|---|
| 91 | + struct clk *clks[], size_t num_clks, |
|---|
| 92 | + unsigned long desired_khz); |
|---|
| 93 | + |
|---|
| 76 | 94 | extern struct platform_driver armada_lcd_platform_driver; |
|---|
| 77 | 95 | |
|---|
| 78 | 96 | #endif |
|---|