{"action":"created","issue":{"url":"https://api.github.com/repos/raspberrypi/linux/issues/1179","labels_url":"https://api.github.com/repos/raspberrypi/linux/issues/1179/labels{/name}","comments_url":"https://api.github.com/repos/raspberrypi/linux/issues/1179/comments","events_url":"https://api.github.com/repos/raspberrypi/linux/issues/1179/events","html_url":"https://github.com/raspberrypi/linux/issues/1179","id":114275222,"number":1179,"title":"Switching on backlight","user":{"login":"pssc","id":1763553,"avatar_url":"https://avatars.githubusercontent.com/u/1763553?v=3","gravatar_id":"","url":"https://api.github.com/users/pssc","html_url":"https://github.com/pssc","followers_url":"https://api.github.com/users/pssc/followers","following_url":"https://api.github.com/users/pssc/following{/other_user}","gists_url":"https://api.github.com/users/pssc/gists{/gist_id}","starred_url":"https://api.github.com/users/pssc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pssc/subscriptions","organizations_url":"https://api.github.com/users/pssc/orgs","repos_url":"https://api.github.com/users/pssc/repos","events_url":"https://api.github.com/users/pssc/events{/privacy}","received_events_url":"https://api.github.com/users/pssc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-30T14:00:47Z","updated_at":"2015-11-02T10:13:33Z","closed_at":null,"body":"[  165.533763] rpi-backlight rpi_backlight: Backlight change failed\r\n[  167.085803] rpi-backlight rpi_backlight: Backlight change failed\r\n[  168.281433] rpi-backlight rpi_backlight: Backlight change failed\r\n[  169.628353] rpi-backlight rpi_backlight: Backlight change failed\r\n[  169.742678] rpi-backlight rpi_backlight: Backlight change failed\r\n\r\nLinux screenpi 4.1.12-v7+ #824 SMP PREEMPT Wed Oct 28 16:46:35 GMT 2015 armv7l GNU/Linux\r\n\r\nI have an application controling the backlight via the \r\n\r\n/sys/class/backlight/rpi_backlight/bl_power\r\n\r\nPowering off writing 4 into the file seems reliable however power on fails.\r\n\r\nI can sometime prod it into life via echoing more stuff into the file manually but its not reliable.\r\n\r\n```\r\n       val = level == 0 and \"4\" or \"0\"\r\n        if self:getSettings()[\"backlight\"] and (not only or only == \"backlight\") then\r\n                dirNodeSetValue(\"/sys/class/backlight\",\"bl_power\",val,skipbacklight)\r\n        end\r\nend\r\n\r\nfunction dirNodeSetValue(dir,node,val,skip)\r\n        for entry in lfs.dir(dir) do repeat\r\n                local entrydir = dir..\"/\"..entry\r\n\r\n                if skip and skip[entry] then\r\n                        break\r\n                end\r\n                local entrymode = lfs.attributes(entrydir, \"mode\")\r\n                log:debug(\"dirNodeSetValue: \",entrydir,\" is \", entrymode)\r\n                if entry:match(\"^%.\") or (entrymode ~= \"directory\") then\r\n                        break\r\n                end\r\n\r\n                local fblank = entrydir..\"/\"..node\r\n                local mode = lfs.attributes(fblank,\"mode\")\r\n                log:debug(\"dirNodeSetValue: \",fblank,\" mode is \", mode)\r\n                if mode == \"file\" then\r\n                        local fh = io.open(fblank,\"w\")\r\n                        if fh then\r\n                                log:info(\"dirNodeSetValue: \",fblank,\" to \",val)\r\n                                fh:write(val)\r\n                                fh:flush()\r\n                                fh:close()\r\n                        end\r\n                end\r\n                break -- oddness as we are in a double loop\r\n        until true end\r\nend\r\n```\r\n\r\nCode works on gpio_backlight for fbtft displays (adafruit28rt).\r\n"},"comment":{"url":"https://api.github.com/repos/raspberrypi/linux/issues/comments/152977273","html_url":"https://github.com/raspberrypi/linux/issues/1179#issuecomment-152977273","issue_url":"https://api.github.com/repos/raspberrypi/linux/issues/1179","id":152977273,"user":{"login":"P33M","id":2474547,"avatar_url":"https://avatars.githubusercontent.com/u/2474547?v=3","gravatar_id":"","url":"https://api.github.com/users/P33M","html_url":"https://github.com/P33M","followers_url":"https://api.github.com/users/P33M/followers","following_url":"https://api.github.com/users/P33M/following{/other_user}","gists_url":"https://api.github.com/users/P33M/gists{/gist_id}","starred_url":"https://api.github.com/users/P33M/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P33M/subscriptions","organizations_url":"https://api.github.com/users/P33M/orgs","repos_url":"https://api.github.com/users/P33M/repos","events_url":"https://api.github.com/users/P33M/events{/privacy}","received_events_url":"https://api.github.com/users/P33M/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T10:13:33Z","updated_at":"2015-11-02T10:13:33Z","body":"You're switching the backlight at a fast interval. I can see two entries in the log that are less than 500ms apart.\r\n\r\nSwitching the backlight on and off that quickly will hit the ratelimit built into the firmware.\r\n\r\nIs the issue still present if your do .. until loop incorporates a ~1 second delay?"}}