Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linux-4-1-15-secoboards-imx6-rel
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ARM
NXP
i.MX6
BSP6
release
linux-4-1-15-secoboards-imx6-rel
Commits
63fb9289
Commit
63fb9289
authored
7 years ago
by
i.MX6 Administrator
Browse files
Options
Downloads
Patches
Plain Diff
LVDS: ldb data mapping is choosed dinamically
parent
9cc68f50
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/video/fbdev/mxc/ldb.c
+51
-17
51 additions, 17 deletions
drivers/video/fbdev/mxc/ldb.c
with
51 additions
and
17 deletions
drivers/video/fbdev/mxc/ldb.c
+
51
−
17
View file @
63fb9289
...
...
@@ -572,26 +572,20 @@ enum {
LVDS_BIT_MAP_JEIDA
,
};
static
const
char
*
ldb_bit_mappings
[]
=
{
[
LVDS_BIT_MAP_SPWG
]
=
"spwg"
,
[
LVDS_BIT_MAP_JEIDA
]
=
"jeida"
,
};
static
int
of_get_data_mapping
(
struct
device_node
*
np
)
{
const
char
*
bm
;
int
ret
,
i
;
static
int
datamap_mode
=
LVDS_BIT_MAP_JEIDA
;
ret
=
of_property_read_string
(
np
,
"fsl,data-mapping"
,
&
bm
);
if
(
ret
<
0
)
return
ret
;
static
int
__init
datamap_mode_setup
(
char
*
options
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ldb_bit_mappings
);
i
++
)
if
(
!
strcasecmp
(
bm
,
ldb_bit_mappings
[
i
]))
return
i
;
if
(
!
strcmp
(
options
,
"jeida"
))
datamap_mode
=
LVDS_BIT_MAP_JEIDA
;
else
if
(
!
strcmp
(
options
,
"spwg"
))
datamap_mode
=
LVDS_BIT_MAP_SPWG
;
else
datamap_mode
=
LVDS_BIT_MAP_JEIDA
;
return
-
EINVAL
;
return
1
;
}
__setup
(
"datamap="
,
datamap_mode_setup
);
static
const
char
*
ldb_crtc_mappings
[]
=
{
[
CRTC_IPU_DI0
]
=
"ipu-di0"
,
...
...
@@ -683,13 +677,53 @@ static int ldb_init(struct mxc_dispdrv_handle *mddh,
struct
fb_videomode
fb_vm
;
enum
crtc
crtc
;
int
chno
,
ret
=
0
;
int
data_width
,
mapping
;
int
data_width
,
mapping
,
i
=
0
;
chno
=
ldb
->
chan
[
ldb
->
primary_chno
].
is_used
?
!
ldb
->
primary_chno
:
ldb
->
primary_chno
;
chan
=
&
ldb
->
chan
[
chno
];
if
(
bits_per_pixel
(
setting
->
if_fmt
)
!=
18
&&
bits_per_pixel
(
setting
->
if_fmt
)
!=
24
)
{
ret
=
of_property_read_u32
(
chan
->
np_timings
,
"fsl,data-width"
,
&
data_width
);
if
(
ret
||
(
data_width
!=
18
&&
data_width
!=
24
))
{
dev_err
(
dev
,
"data width not specified or invalid
\n
"
);
return
-
EINVAL
;
}
}
else
{
data_width
=
bits_per_pixel
(
setting
->
if_fmt
);
}
mapping
=
datamap_mode
;
switch
(
mapping
)
{
case
LVDS_BIT_MAP_SPWG
:
if
(
data_width
==
24
)
{
if
(
i
==
0
||
ldb
->
spl_mode
||
ldb
->
dual_mode
)
ldb
->
ctrl
|=
LDB_DATA_WIDTH_CH0_24
;
if
(
i
==
1
||
ldb
->
spl_mode
||
ldb
->
dual_mode
)
ldb
->
ctrl
|=
LDB_DATA_WIDTH_CH1_24
;
}
break
;
case
LVDS_BIT_MAP_JEIDA
:
if
(
data_width
==
18
)
{
dev_err
(
dev
,
"JEIDA only support 24bit
\n
"
);
return
-
EINVAL
;
}
if
(
i
==
0
||
ldb
->
spl_mode
||
ldb
->
dual_mode
)
ldb
->
ctrl
|=
LDB_DATA_WIDTH_CH0_24
|
LDB_BIT_MAP_CH0_JEIDA
;
if
(
i
==
1
||
ldb
->
spl_mode
||
ldb
->
dual_mode
)
ldb
->
ctrl
|=
LDB_DATA_WIDTH_CH1_24
|
LDB_BIT_MAP_CH1_JEIDA
;
break
;
default:
dev_err
(
dev
,
"data mapping not specified or invalid
\n
"
);
return
-
EINVAL
;
}
crtc
=
of_get_crtc_mapping
(
chan
->
np_timings
);
if
(
is_valid_crtc
(
ldb
,
crtc
,
chan
->
chno
))
{
ldb
->
chan
[
chno
].
crtc
=
crtc
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment