* How to control power of a device from sysfs ?
@ 2016-12-05 7:26 Ran Shalit
2016-12-05 8:24 ` Umair Khan
2016-12-05 10:29 ` Brian Masney
0 siblings, 2 replies; 4+ messages in thread
From: Ran Shalit @ 2016-12-05 7:26 UTC (permalink / raw)
To: kernelnewbies
Hello,
I am trying to turn off screen using sysfs entries,
but I'm having some difficulties with it:
1.
command:
echo 0 > /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/brightness
result:
screen is dimmed - BUT not turned off
2.
command:
cat
/sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/actual_brightness
20
This strengthen the fast that we didn't turned off brightness completely
3. In this point I though that maybe I can turn off the whole brightness
device
ls /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/
actual_brightness
auto_brightness
bl_power
brightness
device
dimming
max_brightness
power
subsystem
type
uevent
I made some trials , but didn't made it turned off yet.
Is there any idea if it's possible to turn it off completely ?
Thank you,
Ran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20161205/1ca0332e/attachment.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* How to control power of a device from sysfs ?
2016-12-05 7:26 How to control power of a device from sysfs ? Ran Shalit
@ 2016-12-05 8:24 ` Umair Khan
2016-12-05 8:48 ` Ran Shalit
2016-12-05 10:29 ` Brian Masney
1 sibling, 1 reply; 4+ messages in thread
From: Umair Khan @ 2016-12-05 8:24 UTC (permalink / raw)
To: kernelnewbies
On Mon, Dec 5, 2016 at 12:56 PM, Ran Shalit <ranshalit@gmail.com> wrote:
> Hello,
>
> I am trying to turn off screen using sysfs entries,
> but I'm having some difficulties with it:
>
> 1.
> command:
> echo 0 > /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/brightness
> result:
> screen is dimmed - BUT not turned off
>
> 2.
> command:
> cat
> /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/actual_brightness
> 20
>
> This strengthen the fast that we didn't turned off brightness completely
>
> 3. In this point I though that maybe I can turn off the whole brightness
> device
>
> ls /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/
> actual_brightness
> auto_brightness
> bl_power
> brightness
> device
> dimming
> max_brightness
> power
> subsystem
> type
> uevent
>
> I made some trials , but didn't made it turned off yet.
> Is there any idea if it's possible to turn it off completely ?
In my opinion, you'll need to have a look into the driver's code.
See if that exposes a mechanism to turn off the screen at all.
- Umair
^ permalink raw reply [flat|nested] 4+ messages in thread
* How to control power of a device from sysfs ?
2016-12-05 8:24 ` Umair Khan
@ 2016-12-05 8:48 ` Ran Shalit
0 siblings, 0 replies; 4+ messages in thread
From: Ran Shalit @ 2016-12-05 8:48 UTC (permalink / raw)
To: kernelnewbies
On Mon, Dec 5, 2016 at 10:24 AM, Umair Khan <omerjerk@gmail.com> wrote:
> On Mon, Dec 5, 2016 at 12:56 PM, Ran Shalit <ranshalit@gmail.com> wrote:
> > Hello,
> >
> > I am trying to turn off screen using sysfs entries,
> > but I'm having some difficulties with it:
> >
> > 1.
> > command:
> > echo 0 > /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/
> brightness
> > result:
> > screen is dimmed - BUT not turned off
> >
> > 2.
> > command:
> > cat
> > /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/
> actual_brightness
> > 20
> >
> > This strengthen the fast that we didn't turned off brightness completely
> >
> > 3. In this point I though that maybe I can turn off the whole brightness
> > device
> >
> > ls /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/
> > actual_brightness
> > auto_brightness
> > bl_power
> > brightness
> > device
> > dimming
> > max_brightness
> > power
> > subsystem
> > type
> > uevent
> >
> > I made some trials , but didn't made it turned off yet.
> > Is there any idea if it's possible to turn it off completely ?
>
> In my opinion, you'll need to have a look into the driver's code.
> See if that exposes a mechanism to turn off the screen at all.
>
>
Right,
Seems that sysfs exports features that drivers might not support (or
supported differently between different drivers)
for ea8061 driver:
Yet, not sure why on setting brightness 0 , I get that that it that
"catual_brightness" is 20.
See ea8061_set_brightness below.
https://github.com/gokhanmoral/siyahkernel-sgs3/blob/master-3.0.31/drivers/video/backlight/ea8061.c
static int ea8061_set_brightness(struct backlight_device *bd)
{
int ret = 0, brightness = bd->props.brightness;
struct ea8061 *lcd = bl_get_data(bd);
if (lcd->power == FB_BLANK_POWERDOWN) {
dev_err(lcd->dev,
"lcd off: brightness set failed.\n");
return -EINVAL;
}
if (brightness < MIN_BRIGHTNESS ||
brightness > bd->props.max_brightness) {
dev_err(lcd->dev, "lcd brightness should be %d to %d.\n",
MIN_BRIGHTNESS, MAX_BRIGHTNESS);
return -EINVAL;
}
ret = ea8061_gamma_ctrl(lcd, brightness);
if (ret) {
dev_err(&bd->dev, "lcd brightness setting failed.\n");
return -EIO;
}
return ret;
}
Thanks,
Ran
- Umair
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20161205/d1953168/attachment-0001.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* How to control power of a device from sysfs ?
2016-12-05 7:26 How to control power of a device from sysfs ? Ran Shalit
2016-12-05 8:24 ` Umair Khan
@ 2016-12-05 10:29 ` Brian Masney
1 sibling, 0 replies; 4+ messages in thread
From: Brian Masney @ 2016-12-05 10:29 UTC (permalink / raw)
To: kernelnewbies
On Mon, Dec 05, 2016 at 09:26:27AM +0200, Ran Shalit wrote:
> Hello,
>
> I am trying to turn off screen using sysfs entries,
> but I'm having some difficulties with it:
>
> 1.
> command:
> echo 0 > /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/brightness
> result:
> screen is dimmed - BUT not turned off
>
> 2.
> command:
> cat
> /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/actual_brightness
> 20
>
> This strengthen the fast that we didn't turned off brightness completely
>
> 3. In this point I though that maybe I can turn off the whole brightness
> device
>
> ls /sys/devices/platform/s5p-dsim.0/ea8061/backlight/panel/
> actual_brightness
> auto_brightness
> bl_power
> brightness
> device
> dimming
> max_brightness
> power
> subsystem
> type
> uevent
>
> I made some trials , but didn't made it turned off yet.
> Is there any idea if it's possible to turn it off completely ?
If the driver supports power management, then you can control the power
state with the power/runtime_status sysfs entry. Some of the sysfs
entries in the power/ directory are documented in
Documentation/ABI/testing/sysfs-devices-power.
Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-05 10:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05 7:26 How to control power of a device from sysfs ? Ran Shalit
2016-12-05 8:24 ` Umair Khan
2016-12-05 8:48 ` Ran Shalit
2016-12-05 10:29 ` Brian Masney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).