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
Kirill Smelkov
linux
Commits
73076481
Commit
73076481
authored
Aug 02, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/backlight: make more consistent with rest of driver style
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
68c99184
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
31 deletions
+39
-31
drivers/gpu/drm/nouveau/nouveau_backlight.c
drivers/gpu/drm/nouveau/nouveau_backlight.c
+39
-31
No files found.
drivers/gpu/drm/nouveau/nouveau_backlight.c
View file @
73076481
...
@@ -38,7 +38,8 @@
...
@@ -38,7 +38,8 @@
#include "nouveau_drm.h"
#include "nouveau_drm.h"
#include "nouveau_reg.h"
#include "nouveau_reg.h"
static
int
nv40_get_intensity
(
struct
backlight_device
*
bd
)
static
int
nv40_get_intensity
(
struct
backlight_device
*
bd
)
{
{
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
int
val
=
(
nv_rd32
(
dev
,
NV40_PMC_BACKLIGHT
)
&
NV40_PMC_BACKLIGHT_MASK
)
int
val
=
(
nv_rd32
(
dev
,
NV40_PMC_BACKLIGHT
)
&
NV40_PMC_BACKLIGHT_MASK
)
...
@@ -47,7 +48,8 @@ static int nv40_get_intensity(struct backlight_device *bd)
...
@@ -47,7 +48,8 @@ static int nv40_get_intensity(struct backlight_device *bd)
return
val
;
return
val
;
}
}
static
int
nv40_set_intensity
(
struct
backlight_device
*
bd
)
static
int
nv40_set_intensity
(
struct
backlight_device
*
bd
)
{
{
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
int
val
=
bd
->
props
.
brightness
;
int
val
=
bd
->
props
.
brightness
;
...
@@ -65,30 +67,8 @@ static const struct backlight_ops nv40_bl_ops = {
...
@@ -65,30 +67,8 @@ static const struct backlight_ops nv40_bl_ops = {
.
update_status
=
nv40_set_intensity
,
.
update_status
=
nv40_set_intensity
,
};
};
static
int
nv50_get_intensity
(
struct
backlight_device
*
bd
)
static
int
{
nv40_backlight_init
(
struct
drm_connector
*
connector
)
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
return
nv_rd32
(
dev
,
NV50_PDISPLAY_SOR_BACKLIGHT
);
}
static
int
nv50_set_intensity
(
struct
backlight_device
*
bd
)
{
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
int
val
=
bd
->
props
.
brightness
;
nv_wr32
(
dev
,
NV50_PDISPLAY_SOR_BACKLIGHT
,
val
|
NV50_PDISPLAY_SOR_BACKLIGHT_ENABLE
);
return
0
;
}
static
const
struct
backlight_ops
nv50_bl_ops
=
{
.
options
=
BL_CORE_SUSPENDRESUME
,
.
get_brightness
=
nv50_get_intensity
,
.
update_status
=
nv50_set_intensity
,
};
static
int
nouveau_nv40_backlight_init
(
struct
drm_connector
*
connector
)
{
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
...
@@ -113,7 +93,33 @@ static int nouveau_nv40_backlight_init(struct drm_connector *connector)
...
@@ -113,7 +93,33 @@ static int nouveau_nv40_backlight_init(struct drm_connector *connector)
return
0
;
return
0
;
}
}
static
int
nouveau_nv50_backlight_init
(
struct
drm_connector
*
connector
)
static
int
nv50_get_intensity
(
struct
backlight_device
*
bd
)
{
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
return
nv_rd32
(
dev
,
NV50_PDISPLAY_SOR_BACKLIGHT
);
}
static
int
nv50_set_intensity
(
struct
backlight_device
*
bd
)
{
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
int
val
=
bd
->
props
.
brightness
;
nv_wr32
(
dev
,
NV50_PDISPLAY_SOR_BACKLIGHT
,
val
|
NV50_PDISPLAY_SOR_BACKLIGHT_ENABLE
);
return
0
;
}
static
const
struct
backlight_ops
nv50_bl_ops
=
{
.
options
=
BL_CORE_SUSPENDRESUME
,
.
get_brightness
=
nv50_get_intensity
,
.
update_status
=
nv50_set_intensity
,
};
static
int
nv50_backlight_init
(
struct
drm_connector
*
connector
)
{
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
...
@@ -137,7 +143,8 @@ static int nouveau_nv50_backlight_init(struct drm_connector *connector)
...
@@ -137,7 +143,8 @@ static int nouveau_nv50_backlight_init(struct drm_connector *connector)
return
0
;
return
0
;
}
}
int
nouveau_backlight_init
(
struct
drm_connector
*
connector
)
int
nouveau_backlight_init
(
struct
drm_connector
*
connector
)
{
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
...
@@ -152,9 +159,9 @@ int nouveau_backlight_init(struct drm_connector *connector)
...
@@ -152,9 +159,9 @@ int nouveau_backlight_init(struct drm_connector *connector)
switch
(
dev_priv
->
card_type
)
{
switch
(
dev_priv
->
card_type
)
{
case
NV_40
:
case
NV_40
:
return
n
ouveau_n
v40_backlight_init
(
connector
);
return
nv40_backlight_init
(
connector
);
case
NV_50
:
case
NV_50
:
return
n
ouveau_n
v50_backlight_init
(
connector
);
return
nv50_backlight_init
(
connector
);
default:
default:
break
;
break
;
}
}
...
@@ -162,7 +169,8 @@ int nouveau_backlight_init(struct drm_connector *connector)
...
@@ -162,7 +169,8 @@ int nouveau_backlight_init(struct drm_connector *connector)
return
0
;
return
0
;
}
}
void
nouveau_backlight_exit
(
struct
drm_connector
*
connector
)
void
nouveau_backlight_exit
(
struct
drm_connector
*
connector
)
{
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
...
...
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