Lines Matching refs:error
287 int error; in da7280_haptic_mem_update() local
290 error = regmap_read(haptics->regmap, DA7280_IRQ_STATUS1, &val); in da7280_haptic_mem_update()
291 if (error) in da7280_haptic_mem_update()
292 return error; in da7280_haptic_mem_update()
301 error = regmap_read(haptics->regmap, DA7280_MEM_CTL2, &val); in da7280_haptic_mem_update()
302 if (error) in da7280_haptic_mem_update()
303 return error; in da7280_haptic_mem_update()
310 error = regmap_update_bits(haptics->regmap, in da7280_haptic_mem_update()
314 if (error) in da7280_haptic_mem_update()
315 return error; in da7280_haptic_mem_update()
317 error = regmap_read(haptics->regmap, DA7280_MEM_CTL1, &val); in da7280_haptic_mem_update()
318 if (error) in da7280_haptic_mem_update()
319 return error; in da7280_haptic_mem_update()
329 int error; in da7280_haptic_set_pwm() local
355 error = pwm_apply_state(haptics->pwm_dev, &state); in da7280_haptic_set_pwm()
356 if (error) in da7280_haptic_set_pwm()
357 dev_err(haptics->dev, "Failed to apply pwm state: %d\n", error); in da7280_haptic_set_pwm()
359 return error; in da7280_haptic_set_pwm()
364 int error; in da7280_haptic_activate() local
378 error = regmap_write(haptics->regmap, DA7280_TOP_CTL2, in da7280_haptic_activate()
380 if (error) { in da7280_haptic_activate()
383 haptics->level, error); in da7280_haptic_activate()
413 error = regmap_update_bits(haptics->regmap, in da7280_haptic_activate()
417 if (error) { in da7280_haptic_activate()
419 "Failed to set operation mode: %d", error); in da7280_haptic_activate()
425 error = regmap_update_bits(haptics->regmap, in da7280_haptic_activate()
429 if (error) { in da7280_haptic_activate()
431 "Failed to start sequence: %d\n", error); in da7280_haptic_activate()
441 int error; in da7280_haptic_deactivate() local
447 error = regmap_update_bits(haptics->regmap, in da7280_haptic_deactivate()
450 if (error) { in da7280_haptic_deactivate()
452 "Failed to clear operation mode: %d", error); in da7280_haptic_deactivate()
458 error = regmap_write(haptics->regmap, in da7280_haptic_deactivate()
460 if (error) { in da7280_haptic_deactivate()
462 "Failed to disable DRO mode: %d\n", error); in da7280_haptic_deactivate()
474 error = regmap_update_bits(haptics->regmap, in da7280_haptic_deactivate()
477 if (error) { in da7280_haptic_deactivate()
480 error); in da7280_haptic_deactivate()
513 int error; in da7280_haptics_upload_effect() local
577 error = da7280_haptic_mem_update(haptics); in da7280_haptics_upload_effect()
578 if (error) { in da7280_haptics_upload_effect()
580 "Failed to upload waveform: %d\n", error); in da7280_haptics_upload_effect()
581 return error; in da7280_haptics_upload_effect()
608 error = regmap_write(haptics->regmap, DA7280_SEQ_CTL2, val); in da7280_haptics_upload_effect()
609 if (error) { in da7280_haptics_upload_effect()
611 "Failed to update PS sequence: %d\n", error); in da7280_haptics_upload_effect()
612 return error; in da7280_haptics_upload_effect()
639 error = regmap_update_bits(haptics->regmap, in da7280_haptics_upload_effect()
643 if (error) { in da7280_haptics_upload_effect()
645 "Failed to update GPI sequence: %d\n", error); in da7280_haptics_upload_effect()
646 return error; in da7280_haptics_upload_effect()
679 int error; in da7280_haptic_start() local
681 error = regmap_update_bits(haptics->regmap, in da7280_haptic_start()
685 if (error) { in da7280_haptic_start()
686 dev_err(haptics->dev, "Unable to enable device: %d\n", error); in da7280_haptic_start()
687 return error; in da7280_haptic_start()
695 int error; in da7280_haptic_stop() local
702 error = regmap_update_bits(haptics->regmap, DA7280_TOP_CTL1, in da7280_haptic_stop()
704 if (error) in da7280_haptic_stop()
705 dev_err(haptics->dev, "Failed to disable device: %d\n", error); in da7280_haptic_stop()
781 int error; in da7280_parse_properties() local
787 error = device_property_read_string(dev, "dlg,actuator-type", &str); in da7280_parse_properties()
788 if (!error) in da7280_parse_properties()
792 error = device_property_read_u32(dev, "dlg,const-op-mode", &val); in da7280_parse_properties()
793 if (!error && val == DA7280_FF_PERIODIC_PWM) in da7280_parse_properties()
797 error = device_property_read_u32(dev, "dlg,periodic-op-mode", &val); in da7280_parse_properties()
798 if (!error && val == DA7280_FF_PERIODIC_ETWM) in da7280_parse_properties()
802 error = device_property_read_u32(dev, "dlg,nom-microvolt", &val); in da7280_parse_properties()
803 if (!error && val < DA7280_VOLTAGE_RATE_MAX) in da7280_parse_properties()
807 error = device_property_read_u32(dev, "dlg,abs-max-microvolt", &val); in da7280_parse_properties()
808 if (!error && val < DA7280_VOLTAGE_RATE_MAX) in da7280_parse_properties()
812 error = device_property_read_u32(dev, "dlg,imax-microamp", &val); in da7280_parse_properties()
813 if (!error && val < DA7280_IMAX_LIMIT) in da7280_parse_properties()
817 error = device_property_read_u32(dev, "dlg,impd-micro-ohms", &val); in da7280_parse_properties()
818 if (!error && val <= DA7280_IMPD_MAX) in da7280_parse_properties()
823 error = device_property_read_u32(dev, "dlg,resonant-freq-hz", &val); in da7280_parse_properties()
824 if (!error) { in da7280_parse_properties()
839 error = device_property_read_u32(dev, "dlg,ps-seq-id", &val); in da7280_parse_properties()
840 if (!error && val <= DA7280_SEQ_ID_MAX) in da7280_parse_properties()
844 error = device_property_read_u32(dev, "dlg,ps-seq-loop", &val); in da7280_parse_properties()
845 if (!error && val <= DA7280_SEQ_LOOP_MAX) in da7280_parse_properties()
852 error = device_property_read_u32 (dev, gpi_str1, &val); in da7280_parse_properties()
853 if (!error && val <= DA7280_SEQ_ID_MAX) in da7280_parse_properties()
858 error = device_property_read_string(dev, gpi_str2, &str); in da7280_parse_properties()
859 if (!error) in da7280_parse_properties()
865 error = device_property_read_string(dev, gpi_str3, &str); in da7280_parse_properties()
866 if (!error) in da7280_parse_properties()
883 error = device_property_read_u32_array(dev, "dlg,mem-array", in da7280_parse_properties()
885 if (!error) { in da7280_parse_properties()
907 int error; in da7280_irq_handler() local
910 error = regmap_bulk_read(haptics->regmap, DA7280_IRQ_EVENT1, in da7280_irq_handler()
912 if (error) { in da7280_irq_handler()
913 dev_err(dev, "failed to read interrupt data: %d\n", error); in da7280_irq_handler()
918 error = regmap_write(haptics->regmap, DA7280_IRQ_EVENT1, events[0]); in da7280_irq_handler()
919 if (error) { in da7280_irq_handler()
920 dev_err(dev, "failed to clear interrupts: %d\n", error); in da7280_irq_handler()
929 error = regmap_update_bits(haptics->regmap, DA7280_TOP_CTL1, in da7280_irq_handler()
931 if (error) in da7280_irq_handler()
933 error); in da7280_irq_handler()
966 int error, i; in da7280_init() local
974 error = regmap_read(haptics->regmap, DA7280_TOP_CFG1, &val); in da7280_init()
975 if (error) in da7280_init()
985 error = regmap_write(haptics->regmap, DA7280_FRQ_LRA_PER_H, in da7280_init()
987 if (error) in da7280_init()
989 error = regmap_write(haptics->regmap, DA7280_FRQ_LRA_PER_L, in da7280_init()
991 if (error) in da7280_init()
994 error = regmap_update_bits(haptics->regmap, DA7280_TOP_INT_CFG1, in da7280_init()
996 if (error) in da7280_init()
1003 error = regmap_update_bits(haptics->regmap, DA7280_TOP_CFG4, in da7280_init()
1005 if (error) in da7280_init()
1032 error = regmap_update_bits(haptics->regmap, DA7280_TOP_CFG1, mask, val); in da7280_init()
1033 if (error) in da7280_init()
1036 error = regmap_update_bits(haptics->regmap, DA7280_TOP_CFG5, in da7280_init()
1040 if (error) in da7280_init()
1043 error = regmap_update_bits(haptics->regmap, in da7280_init()
1048 if (error) in da7280_init()
1052 error = regmap_write(haptics->regmap, DA7280_ACTUATOR1, in da7280_init()
1054 if (error) in da7280_init()
1059 error = regmap_write(haptics->regmap, DA7280_ACTUATOR2, in da7280_init()
1061 if (error) in da7280_init()
1065 error = regmap_update_bits(haptics->regmap, DA7280_ACTUATOR3, in da7280_init()
1067 if (error) in da7280_init()
1071 error = regmap_write(haptics->regmap, DA7280_CALIB_V2I_L, in da7280_init()
1073 if (error) in da7280_init()
1075 error = regmap_write(haptics->regmap, DA7280_CALIB_V2I_H, in da7280_init()
1077 if (error) in da7280_init()
1080 error = regmap_update_bits(haptics->regmap, in da7280_init()
1084 if (error) in da7280_init()
1088 error = da7280_haptic_mem_update(haptics); in da7280_init()
1089 if (error) in da7280_init()
1096 error = regmap_write(haptics->regmap, DA7280_SEQ_CTL2, val); in da7280_init()
1097 if (error) in da7280_init()
1108 error = regmap_write(haptics->regmap, in da7280_init()
1110 if (error) in da7280_init()
1115 error = regmap_update_bits(haptics->regmap, in da7280_init()
1119 if (error) in da7280_init()
1123 error = regmap_write(haptics->regmap, DA7280_IRQ_EVENT1, 0xff); in da7280_init()
1124 if (error) in da7280_init()
1127 error = regmap_update_bits(haptics->regmap, in da7280_init()
1132 if (error) in da7280_init()
1139 dev_err(haptics->dev, "chip initialization error: %d\n", error); in da7280_init()
1140 return error; in da7280_init()
1151 int error; in da7280_probe() local
1168 error = PTR_ERR_OR_ZERO(haptics->pwm_dev); in da7280_probe()
1169 if (error) { in da7280_probe()
1170 if (error != -EPROBE_DEFER) in da7280_probe()
1172 error); in da7280_probe()
1173 return error; in da7280_probe()
1179 error = pwm_apply_state(haptics->pwm_dev, &state); in da7280_probe()
1180 if (error) { in da7280_probe()
1181 dev_err(dev, "Failed to apply PWM state: %d\n", error); in da7280_probe()
1182 return error; in da7280_probe()
1203 error = PTR_ERR_OR_ZERO(haptics->regmap); in da7280_probe()
1204 if (error) { in da7280_probe()
1205 dev_err(dev, "Failed to allocate register map: %d\n", error); in da7280_probe()
1206 return error; in da7280_probe()
1209 error = da7280_init(haptics); in da7280_probe()
1210 if (error) { in da7280_probe()
1211 dev_err(dev, "Failed to initialize device: %d\n", error); in da7280_probe()
1212 return error; in da7280_probe()
1234 error = input_ff_create(haptics->input_dev, in da7280_probe()
1236 if (error) { in da7280_probe()
1237 dev_err(dev, "Failed to create FF input device: %d\n", error); in da7280_probe()
1238 return error; in da7280_probe()
1245 error = input_register_device(input_dev); in da7280_probe()
1246 if (error) { in da7280_probe()
1247 dev_err(dev, "Failed to register input device: %d\n", error); in da7280_probe()
1248 return error; in da7280_probe()
1251 error = devm_request_threaded_irq(dev, client->irq, in da7280_probe()
1255 if (error) { in da7280_probe()
1257 client->irq, error); in da7280_probe()
1258 return error; in da7280_probe()