aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/mgag200/mgag200_drv.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2021-07-14 16:22:37 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2021-08-08 20:14:05 +0200
commit2545ac960364d0395802a27374b46f13827b4cf5 (patch)
tree1e63208d408a59cc7b451ca775f8a88e2ec4a250 /drivers/gpu/drm/mgag200/mgag200_drv.h
parentdrm/mgag200: Declare PLL clock constants static const (diff)
downloadwireguard-linux-2545ac960364d0395802a27374b46f13827b4cf5.tar.xz
wireguard-linux-2545ac960364d0395802a27374b46f13827b4cf5.zip
drm/mgag200: Abstract pixel PLL via struct mgag200_pll
Move all PLL compute and update functions into mgag200_pll.c. No functional changes to the rsp algorithms. Introduce struct mgag200_pll and mgag200_pll_funcs. The data strutures abstract the details of each revision's PLL. Perform calls to compute and update functionality via function pointers. Init the PLL once as part of the driver initialization. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-11-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/mgag200/mgag200_drv.h')
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_drv.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h
index b5d9c0ca757b..e6f37cd23eec 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.h
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.h
@@ -126,6 +126,9 @@
#define MGAG200_MAX_FB_HEIGHT 4096
#define MGAG200_MAX_FB_WIDTH 4096
+struct mga_device;
+struct mgag200_pll;
+
/*
* Stores parameters for programming the PLLs
*
@@ -143,6 +146,17 @@ struct mgag200_pll_values {
unsigned int s;
};
+struct mgag200_pll_funcs {
+ int (*compute)(struct mgag200_pll *pll, long clock, struct mgag200_pll_values *pllc);
+ void (*update)(struct mgag200_pll *pll, const struct mgag200_pll_values *pllc);
+};
+
+struct mgag200_pll {
+ struct mga_device *mdev;
+
+ const struct mgag200_pll_funcs *funcs;
+};
+
#define to_mga_connector(x) container_of(x, struct mga_connector, base)
struct mga_i2c_chan {
@@ -213,8 +227,8 @@ struct mga_device {
} g200se;
} model;
-
struct mga_connector connector;
+ struct mgag200_pll pixpll;
struct drm_simple_display_pipe display_pipe;
};
@@ -233,4 +247,7 @@ void mgag200_i2c_destroy(struct mga_i2c_chan *i2c);
/* mgag200_mm.c */
int mgag200_mm_init(struct mga_device *mdev);
+ /* mgag200_pll.c */
+int mgag200_pixpll_init(struct mgag200_pll *pixpll, struct mga_device *mdev);
+
#endif /* __MGAG200_DRV_H__ */