aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/aptina-pll.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-02-25 11:24:50 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-03-19 17:53:39 -0400
commit0b27c81ba32de6f5eb9df769d839bab399c4c6de (patch)
treee5c567d22d5e395bdbee359ef327eb676cd5e9e2 /drivers/media/video/aptina-pll.h
parentc0f9976662fa569e3760187d51bc4cd7b8f00e1d (diff)
[media] v4l: Aptina-style sensor PLL support
Add a generic helper function to compute PLL parameters for PLL found in several Aptina sensors. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/aptina-pll.h')
-rw-r--r--drivers/media/video/aptina-pll.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/drivers/media/video/aptina-pll.h b/drivers/media/video/aptina-pll.h
new file mode 100644
index 000000000000..b370e341e75d
--- /dev/null
+++ b/drivers/media/video/aptina-pll.h
@@ -0,0 +1,56 @@
1/*
2 * Aptina Sensor PLL Configuration
3 *
4 * Copyright (C) 2012 Laurent Pinchart <laurent.pinchart@ideasonboard.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 */
20
21#ifndef __APTINA_PLL_H
22#define __APTINA_PLL_H
23
24struct aptina_pll {
25 unsigned int ext_clock;
26 unsigned int pix_clock;
27
28 unsigned int n;
29 unsigned int m;
30 unsigned int p1;
31};
32
33struct aptina_pll_limits {
34 unsigned int ext_clock_min;
35 unsigned int ext_clock_max;
36 unsigned int int_clock_min;
37 unsigned int int_clock_max;
38 unsigned int out_clock_min;
39 unsigned int out_clock_max;
40 unsigned int pix_clock_max;
41
42 unsigned int n_min;
43 unsigned int n_max;
44 unsigned int m_min;
45 unsigned int m_max;
46 unsigned int p1_min;
47 unsigned int p1_max;
48};
49
50struct device;
51
52int aptina_pll_calculate(struct device *dev,
53 const struct aptina_pll_limits *limits,
54 struct aptina_pll *pll);
55
56#endif /* __APTINA_PLL_H */