Linux Audio

Check our new training course

Loading...
v3.1
 
 1#ifndef __VIDEO_SH_MOBILE_MERAM_H__
 2#define __VIDEO_SH_MOBILE_MERAM_H__
 3
 4/* For sh_mobile_meram_info.addr_mode */
 5enum {
 6	SH_MOBILE_MERAM_MODE0 = 0,
 7	SH_MOBILE_MERAM_MODE1
 8};
 9
10enum {
11	SH_MOBILE_MERAM_PF_NV = 0,
12	SH_MOBILE_MERAM_PF_RGB,
13	SH_MOBILE_MERAM_PF_NV24
14};
15
16
17struct sh_mobile_meram_priv;
18struct sh_mobile_meram_ops;
19
 
 
 
 
20struct sh_mobile_meram_info {
21	int				addr_mode;
22	struct sh_mobile_meram_ops	*ops;
23	struct sh_mobile_meram_priv	*priv;
24	struct platform_device		*pdev;
25};
26
27/* icb config */
28struct sh_mobile_meram_icb {
29	int marker_icb;		/* ICB # for Marker ICB */
30	int cache_icb;		/* ICB # for Cache ICB */
31	int meram_offset;	/* MERAM Buffer Offset to use */
32	int meram_size;		/* MERAM Buffer Size to use */
33
34	int cache_unit;		/* bytes to cache per ICB */
35};
36
37struct sh_mobile_meram_cfg {
38	struct sh_mobile_meram_icb	icb[2];
39	int				pixelformat;
40	int				current_reg;
41};
42
43struct module;
44struct sh_mobile_meram_ops {
45	struct module	*module;
46	/* register usage of meram */
47	int (*meram_register)(struct sh_mobile_meram_info *meram_dev,
48			      struct sh_mobile_meram_cfg *cfg,
49			      int xres, int yres, int pixelformat,
50			      unsigned long base_addr_y,
51			      unsigned long base_addr_c,
52			      unsigned long *icb_addr_y,
53			      unsigned long *icb_addr_c, int *pitch);
54
55	/* unregister usage of meram */
56	int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
57				struct sh_mobile_meram_cfg *cfg);
58
59	/* update meram settings */
60	int (*meram_update)(struct sh_mobile_meram_info *meram_dev,
61			    struct sh_mobile_meram_cfg *cfg,
62			    unsigned long base_addr_y,
63			    unsigned long base_addr_c,
64			    unsigned long *icb_addr_y,
65			    unsigned long *icb_addr_c);
66};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
68#endif /* __VIDEO_SH_MOBILE_MERAM_H__  */
v4.17
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef __VIDEO_SH_MOBILE_MERAM_H__
 3#define __VIDEO_SH_MOBILE_MERAM_H__
 4
 5/* For sh_mobile_meram_info.addr_mode */
 6enum {
 7	SH_MOBILE_MERAM_MODE0 = 0,
 8	SH_MOBILE_MERAM_MODE1
 9};
10
11enum {
12	SH_MOBILE_MERAM_PF_NV = 0,
13	SH_MOBILE_MERAM_PF_RGB,
14	SH_MOBILE_MERAM_PF_NV24
15};
16
17
18struct sh_mobile_meram_priv;
 
19
20/*
21 * struct sh_mobile_meram_info - MERAM platform data
22 * @reserved_icbs: Bitmask of reserved ICBs (for instance used through UIO)
23 */
24struct sh_mobile_meram_info {
25	int				addr_mode;
26	u32				reserved_icbs;
27	struct sh_mobile_meram_priv	*priv;
28	struct platform_device		*pdev;
29};
30
31/* icb config */
32struct sh_mobile_meram_icb_cfg {
33	unsigned int meram_size;	/* MERAM Buffer Size to use */
 
 
 
 
 
34};
35
36struct sh_mobile_meram_cfg {
37	struct sh_mobile_meram_icb_cfg icb[2];
 
 
38};
39
40#if defined(CONFIG_FB_SH_MOBILE_MERAM) || \
41    defined(CONFIG_FB_SH_MOBILE_MERAM_MODULE)
42unsigned long sh_mobile_meram_alloc(struct sh_mobile_meram_info *meram_dev,
43				    size_t size);
44void sh_mobile_meram_free(struct sh_mobile_meram_info *meram_dev,
45			  unsigned long mem, size_t size);
46void *sh_mobile_meram_cache_alloc(struct sh_mobile_meram_info *dev,
47				  const struct sh_mobile_meram_cfg *cfg,
48				  unsigned int xres, unsigned int yres,
49				  unsigned int pixelformat,
50				  unsigned int *pitch);
51void sh_mobile_meram_cache_free(struct sh_mobile_meram_info *dev, void *data);
52void sh_mobile_meram_cache_update(struct sh_mobile_meram_info *dev, void *data,
53				  unsigned long base_addr_y,
54				  unsigned long base_addr_c,
55				  unsigned long *icb_addr_y,
56				  unsigned long *icb_addr_c);
57#else
58static inline unsigned long
59sh_mobile_meram_alloc(struct sh_mobile_meram_info *meram_dev, size_t size)
60{
61	return 0;
62}
63
64static inline void
65sh_mobile_meram_free(struct sh_mobile_meram_info *meram_dev,
66		     unsigned long mem, size_t size)
67{
68}
69
70static inline void *
71sh_mobile_meram_cache_alloc(struct sh_mobile_meram_info *dev,
72			    const struct sh_mobile_meram_cfg *cfg,
73			    unsigned int xres, unsigned int yres,
74			    unsigned int pixelformat,
75			    unsigned int *pitch)
76{
77	return ERR_PTR(-ENODEV);
78}
79
80static inline void
81sh_mobile_meram_cache_free(struct sh_mobile_meram_info *dev, void *data)
82{
83}
84
85static inline void
86sh_mobile_meram_cache_update(struct sh_mobile_meram_info *dev, void *data,
87			     unsigned long base_addr_y,
88			     unsigned long base_addr_c,
89			     unsigned long *icb_addr_y,
90			     unsigned long *icb_addr_c)
91{
92}
93#endif
94
95#endif /* __VIDEO_SH_MOBILE_MERAM_H__  */