Lines Matching +full:loss +full:- +full:of +full:- +full:lock
2 * drivers/leds/leds-apu.c
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
11 * notice, this list of conditions and the following disclaimer in the
13 * 3. Neither the names of the copyright holders nor the names of its
17 * Alternatively, this software may be distributed under the terms of the
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
74 spinlock_t lock; member
86 /* PC Engines APU with factory bios "SageBios_PCEngines_APU-45" */
110 spin_lock(&apu_led->lock); in apu1_led_brightness_set()
111 iowrite8(value ? APU1_LEDON : APU1_LEDOFF, pled->param.addr); in apu1_led_brightness_set()
112 spin_unlock(&apu_led->lock); in apu1_led_brightness_set()
120 apu_led->pled = devm_kcalloc(dev, in apu_led_config()
124 if (!apu_led->pled) in apu_led_config()
125 return -ENOMEM; in apu_led_config()
128 struct apu_led_priv *pled = &apu_led->pled[i]; in apu_led_config()
129 struct led_classdev *led_cdev = &pled->cdev; in apu_led_config()
131 led_cdev->name = apu1_led_profile[i].name; in apu_led_config()
132 led_cdev->brightness = apu1_led_profile[i].brightness; in apu_led_config()
133 led_cdev->max_brightness = 1; in apu_led_config()
134 led_cdev->flags = LED_CORE_SUSPENDRESUME; in apu_led_config()
135 led_cdev->brightness_set = apu1_led_brightness_set; in apu_led_config()
137 pled->param.addr = devm_ioremap(dev, in apu_led_config()
139 if (!pled->param.addr) { in apu_led_config()
140 err = -ENOMEM; in apu_led_config()
154 while (i-- > 0) in apu_led_config()
155 led_classdev_unregister(&apu_led->pled[i].cdev); in apu_led_config()
162 apu_led = devm_kzalloc(&pdev->dev, sizeof(*apu_led), GFP_KERNEL); in apu_led_probe()
165 return -ENOMEM; in apu_led_probe()
167 apu_led->pdev = pdev; in apu_led_probe()
169 spin_lock_init(&apu_led->lock); in apu_led_probe()
170 return apu_led_config(&pdev->dev, apu_led); in apu_led_probe()
187 return -ENODEV; in apu_led_init()
190 pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0); in apu_led_init()
210 led_classdev_unregister(&apu_led->pled[i].cdev); in apu_led_exit()
212 platform_device_unregister(apu_led->pdev); in apu_led_exit()