blob: 8ee87174c601ef34a0aec25935559e304a2c0c39 [file] [log] [blame]
Padmanabhan Komanduru40f0d3c2018-04-26 17:41:17 +05301/* Copyright (c) 2013-2015, 2018, The Linux Foundation. All rights reserved.
Arpita Banerjeeda0c39a2013-05-24 16:12:45 -07002 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions
5 * are met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in
10 * the documentation and/or other materials provided with the
11 * distribution.
12 * * Neither the name of The Linux Foundation nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
23 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#ifndef _GCDB_AUTOPLL_H_
31#define _GCDB_AUTOPLL_H_
32
33/*---------------------------------------------------------------------------*/
34/* HEADER files */
35/*---------------------------------------------------------------------------*/
36#include <debug.h>
37
38#define VCO_MIN_CLOCK 350000000
39#define VCO_MAX_CLOCK 750000000
40
41#define HALFBIT_CLOCK1 175000000 /* VCO min clock div by 2 */
42#define HALFBIT_CLOCK2 88000000 /* VCO min clock div by 4 */
43#define HALFBIT_CLOCK3 44000000 /* VCO min clock div by 8 */
44#define HALFBIT_CLOCK4 40000000 /* VCO min clock div by 9 */
45
Dhaval Pateld19fcf12014-08-12 13:16:05 -070046#define HALFBIT_CLOCK1_20NM 500000000 /* VCO min clock div by 2 */
47#define HALFBIT_CLOCK2_20NM 250000000 /* VCO min clock div by 4 */
48#define HALFBIT_CLOCK3_20NM 125000000 /* VCO min clock div by 8 */
49#define HALFBIT_CLOCK4_20NM 120000000 /* VCO min clock div by 9 */
50
Arpita Banerjeeda0c39a2013-05-24 16:12:45 -070051#define BITS_24 24
52#define BITS_18 18
53#define BITS_16 16
54
Dhaval Patel8b9a5822015-03-16 13:01:26 -070055#define MAX_THULIUM_VCO_RATE 2600000000
56#define MIN_THULIUM_VCO_RATE 1300000000
57#define MAX_THULIUM_DIV_VAL 15
58#define MIN_THULIUM_DIV_VAL 1
59#define FIX_PIXEL_CLOCK_DIV 2
60#define FIX_N_DIV 1
61
Padmanabhan Komanduru40f0d3c2018-04-26 17:41:17 +053062#define MIN_12NM_VCO_RATE 1000000000
63#define MAX_12NM_VCO_RATE 2000000000
64
Arpita Banerjeeda0c39a2013-05-24 16:12:45 -070065/*---------------------------------------------------------------------------*/
66/* Structure definition */
67/*---------------------------------------------------------------------------*/
68
69uint32_t calculate_clock_config(struct msm_panel_info *pinfo);
70
71#endif /*_GCDB_AUTOPLL_H_ */