Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a8ed0b16
Commit
a8ed0b16
authored
Sep 28, 2010
by
Chris Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/i915: Tidy dvo_ch7017 and print out which chip we detect
Signed-off-by:
Chris Wilson
<
chris@chris-wilson.co.uk
>
parent
b8232e90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
36 deletions
+27
-36
drivers/gpu/drm/i915/dvo_ch7017.c
drivers/gpu/drm/i915/dvo_ch7017.c
+27
-36
No files found.
drivers/gpu/drm/i915/dvo_ch7017.c
View file @
a8ed0b16
...
...
@@ -165,56 +165,35 @@ struct ch7017_priv {
static
void
ch7017_dump_regs
(
struct
intel_dvo_device
*
dvo
);
static
void
ch7017_dpms
(
struct
intel_dvo_device
*
dvo
,
int
mode
);
static
bool
ch7017_read
(
struct
intel_dvo_device
*
dvo
,
int
addr
,
uint8_t
*
val
)
static
bool
ch7017_read
(
struct
intel_dvo_device
*
dvo
,
u8
addr
,
u8
*
val
)
{
struct
i2c_adapter
*
adapter
=
dvo
->
i2c_bus
;
u8
out_buf
[
2
];
u8
in_buf
[
2
];
struct
i2c_msg
msgs
[]
=
{
{
.
addr
=
dvo
->
slave_addr
,
.
flags
=
0
,
.
len
=
1
,
.
buf
=
out_buf
,
.
buf
=
&
addr
,
},
{
.
addr
=
dvo
->
slave_addr
,
.
flags
=
I2C_M_RD
,
.
len
=
1
,
.
buf
=
in_buf
,
.
buf
=
val
,
}
};
out_buf
[
0
]
=
addr
;
out_buf
[
1
]
=
0
;
if
(
i2c_transfer
(
adapter
,
msgs
,
2
)
==
2
)
{
*
val
=
in_buf
[
0
];
return
true
;
};
return
false
;
return
i2c_transfer
(
dvo
->
i2c_bus
,
msgs
,
2
)
==
2
;
}
static
bool
ch7017_write
(
struct
intel_dvo_device
*
dvo
,
int
addr
,
uint8_t
val
)
static
bool
ch7017_write
(
struct
intel_dvo_device
*
dvo
,
u8
addr
,
u8
val
)
{
struct
i2c_adapter
*
adapter
=
dvo
->
i2c_bus
;
uint8_t
out_buf
[
2
];
uint8_t
buf
[
2
]
=
{
addr
,
val
};
struct
i2c_msg
msg
=
{
.
addr
=
dvo
->
slave_addr
,
.
flags
=
0
,
.
len
=
2
,
.
buf
=
out_
buf
,
.
buf
=
buf
,
};
out_buf
[
0
]
=
addr
;
out_buf
[
1
]
=
val
;
if
(
i2c_transfer
(
adapter
,
&
msg
,
1
)
==
1
)
return
true
;
return
false
;
return
i2c_transfer
(
dvo
->
i2c_bus
,
&
msg
,
1
)
==
1
;
}
/** Probes for a CH7017 on the given bus and slave address. */
...
...
@@ -222,7 +201,8 @@ static bool ch7017_init(struct intel_dvo_device *dvo,
struct
i2c_adapter
*
adapter
)
{
struct
ch7017_priv
*
priv
;
uint8_t
val
;
const
char
*
str
;
u8
val
;
priv
=
kzalloc
(
sizeof
(
struct
ch7017_priv
),
GFP_KERNEL
);
if
(
priv
==
NULL
)
...
...
@@ -234,16 +214,27 @@ static bool ch7017_init(struct intel_dvo_device *dvo,
if
(
!
ch7017_read
(
dvo
,
CH7017_DEVICE_ID
,
&
val
))
goto
fail
;
if
(
val
!=
CH7017_DEVICE_ID_VALUE
&&
val
!=
CH7018_DEVICE_ID_VALUE
&&
val
!=
CH7019_DEVICE_ID_VALUE
)
{
switch
(
val
)
{
case
CH7017_DEVICE_ID_VALUE
:
str
=
"ch7017"
;
break
;
case
CH7018_DEVICE_ID_VALUE
:
str
=
"ch7018"
;
break
;
case
CH7019_DEVICE_ID_VALUE
:
str
=
"ch7019"
;
break
;
default:
DRM_DEBUG_KMS
(
"ch701x not detected, got %d: from %s "
"S
lave %d.
\n
"
,
val
,
adapter
->
name
,
dvo
->
slave_addr
);
"s
lave %d.
\n
"
,
val
,
adapter
->
name
,
dvo
->
slave_addr
);
goto
fail
;
}
DRM_DEBUG_KMS
(
"%s detected on %s, addr %d
\n
"
,
str
,
adapter
->
name
,
dvo
->
slave_addr
);
return
true
;
fail:
kfree
(
priv
);
return
false
;
...
...
@@ -365,7 +356,7 @@ static void ch7017_dpms(struct intel_dvo_device *dvo, int mode)
}
/* XXX: Should actually wait for update power status somehow */
udelay
(
2000
0
);
msleep
(
2
0
);
}
static
void
ch7017_dump_regs
(
struct
intel_dvo_device
*
dvo
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment