Lines Matching refs:result
299 int result; in stk8baxx_chk_for_addr() local
308 result = stk8baxx_smbus_write_byte_data(STK8BAXX_SWRST, STK8BAXX_SWRST_VAL); in stk8baxx_chk_for_addr()
309 printk(KERN_INFO "%s:issue sw reset to 0x%x, result=%d\n", __func__, reset_address, result); in stk8baxx_chk_for_addr()
314 result = stk8baxx_smbus_write_byte_data(STK8BAXX_POWMODE, STK8BAXX_MD_NORMAL); in stk8baxx_chk_for_addr()
315 result = stk8baxx_smbus_read_byte_data(0x0); in stk8baxx_chk_for_addr()
316 if (result < 0) { in stk8baxx_chk_for_addr()
317 printk(KERN_INFO "%s: read 0x0, result=%d\n", __func__, result); in stk8baxx_chk_for_addr()
318 return result; in stk8baxx_chk_for_addr()
320 if (result == expected_reg0) { in stk8baxx_chk_for_addr()
322 result = stk8baxx_smbus_write_byte_data(STK8BAXX_SWRST, STK8BAXX_SWRST_VAL); in stk8baxx_chk_for_addr()
323 if (result < 0) { in stk8baxx_chk_for_addr()
324 printk(KERN_ERR "%s:failed to issue software reset, error=%d\n", __func__, result); in stk8baxx_chk_for_addr()
325 return result; in stk8baxx_chk_for_addr()
336 int result; in stk8baxx_sw_reset() local
342 result = stk8baxx_chk_for_addr(stk, org_addr, 0x18); in stk8baxx_sw_reset()
343 if (result == 1) in stk8baxx_sw_reset()
345 result = stk8baxx_chk_for_addr(stk, org_addr, 0x19); in stk8baxx_sw_reset()
346 if (result == 1) in stk8baxx_sw_reset()
348 result = stk8baxx_chk_for_addr(stk, org_addr, 0x08); in stk8baxx_sw_reset()
349 if (result == 1) in stk8baxx_sw_reset()
351 result = stk8baxx_chk_for_addr(stk, org_addr, 0x28); in stk8baxx_sw_reset()
352 if (result == 1) in stk8baxx_sw_reset()
355 result = stk8baxx_chk_for_addr(stk, org_addr, 0x28); in stk8baxx_sw_reset()
356 if (result == 1) in stk8baxx_sw_reset()
358 result = stk8baxx_chk_for_addr(stk, org_addr, 0x18); in stk8baxx_sw_reset()
359 if (result == 1) in stk8baxx_sw_reset()
361 result = stk8baxx_chk_for_addr(stk, org_addr, 0x08); in stk8baxx_sw_reset()
362 if (result == 1) in stk8baxx_sw_reset()
365 result = stk8baxx_chk_for_addr(stk, org_addr, 0x0B); in stk8baxx_sw_reset()
371 int result; in stk8baxx_reg_init() local
381 result = stk8baxx_sw_reset(stk); in stk8baxx_reg_init()
382 if (result < 0) { in stk8baxx_reg_init()
383 printk(KERN_ERR "%s:failed to stk8baxx_sw_reset, error=%d\n", __func__, result); in stk8baxx_reg_init()
384 return result; in stk8baxx_reg_init()
387 result = stk8baxx_smbus_write_byte_data(STK8BAXX_POWMODE, STK8BAXX_MD_NORMAL); in stk8baxx_reg_init()
388 if (result < 0) { in stk8baxx_reg_init()
389 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_POWMODE, result); in stk8baxx_reg_init()
390 return result; in stk8baxx_reg_init()
393 result = stk8baxx_smbus_read_byte_data(STK8BAXX_LGDLY); in stk8baxx_reg_init()
394 if (result < 0) { in stk8baxx_reg_init()
395 printk(KERN_ERR "%s: failed to read acc data, error=%d\n", __func__, result); in stk8baxx_reg_init()
396 return result; in stk8baxx_reg_init()
399 if (result == STK8BA50_ID) { in stk8baxx_reg_init()
403 result = stk8baxx_smbus_read_byte_data(0x0); in stk8baxx_reg_init()
404 if (result < 0) { in stk8baxx_reg_init()
405 printk(KERN_ERR "%s: failed to read acc data, error=%d\n", __func__, result); in stk8baxx_reg_init()
406 return result; in stk8baxx_reg_init()
408 printk(KERN_INFO "%s: 0x0=0x%x\n", __func__, result); in stk8baxx_reg_init()
409 if (result == STK8BA50R_ID) { in stk8baxx_reg_init()
430 result = stk8baxx_smbus_write_byte_data(STK8BAXX_INTMAP2, 0x01); in stk8baxx_reg_init()
431 if (result < 0) { in stk8baxx_reg_init()
432 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_INTMAP2, result); in stk8baxx_reg_init()
433 return result; in stk8baxx_reg_init()
436 result = stk8baxx_smbus_write_byte_data(STK8BAXX_INTEN2, 0x10); in stk8baxx_reg_init()
437 if (result < 0) { in stk8baxx_reg_init()
438 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_INTEN2, result); in stk8baxx_reg_init()
439 return result; in stk8baxx_reg_init()
442 result = stk8baxx_smbus_write_byte_data(STK8BAXX_INTCFG2, 0x00); in stk8baxx_reg_init()
443 if (result < 0) { in stk8baxx_reg_init()
444 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_INTCFG2, result); in stk8baxx_reg_init()
445 return result; in stk8baxx_reg_init()
448 result = stk8baxx_smbus_write_byte_data(STK8BAXX_DATASRC, 0x00); in stk8baxx_reg_init()
449 if (result < 0) { in stk8baxx_reg_init()
450 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_DATASRC, result); in stk8baxx_reg_init()
451 return result; in stk8baxx_reg_init()
454 result = stk8baxx_smbus_write_byte_data(STK8BAXX_INTCFG1, 0x01); in stk8baxx_reg_init()
455 if (result < 0) { in stk8baxx_reg_init()
456 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_INTCFG1, result); in stk8baxx_reg_init()
457 return result; in stk8baxx_reg_init()
462 result = stk8baxx_smbus_write_byte_data(STK8BAXX_RANGESEL, STK_DEF_DYNAMIC_RANGE); in stk8baxx_reg_init()
463 if (result < 0) { in stk8baxx_reg_init()
464 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_RANGESEL, result); in stk8baxx_reg_init()
465 return result; in stk8baxx_reg_init()
469 result = stk8baxx_smbus_write_byte_data(STK8BAXX_RANGESEL, STK_DEF_DYNAMIC_RANGE); in stk8baxx_reg_init()
470 if (result < 0) { in stk8baxx_reg_init()
471 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_RANGESEL, result); in stk8baxx_reg_init()
472 return result; in stk8baxx_reg_init()
476 result = stk8baxx_smbus_write_byte_data(STK8BAXX_BWSEL, STK8BAXX_INIT_ODR); in stk8baxx_reg_init()
477 if (result < 0) { in stk8baxx_reg_init()
478 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_BWSEL, result); in stk8baxx_reg_init()
479 return result; in stk8baxx_reg_init()
483 result = stk8baxx_smbus_write_byte_data(STK8BAXX_INTFCFG, 0x04); in stk8baxx_reg_init()
484 if (result < 0) { in stk8baxx_reg_init()
485 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_INTFCFG, result); in stk8baxx_reg_init()
486 return result; in stk8baxx_reg_init()
489 result = stk8baxx_smbus_write_byte_data(STK8BAXX_POWMODE, STK8BAXX_MD_SUSPEND); in stk8baxx_reg_init()
490 if (result < 0) { in stk8baxx_reg_init()
491 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_POWMODE, result); in stk8baxx_reg_init()
492 return result; in stk8baxx_reg_init()
682 s8 result; in stk8baxx_set_enable() local
705 result = stk8baxx_smbus_write_byte_data(STK8BAXX_POWMODE, write_buffer); in stk8baxx_set_enable()
706 if (result < 0) { in stk8baxx_set_enable()
707 printk(KERN_ERR "%s:failed to write reg 0x%x, error=%d\n", __func__, STK8BAXX_POWMODE, result); in stk8baxx_set_enable()
725 return result; in stk8baxx_set_enable()
746 int result; in stk8baxx_read_sensor_data() local
760 result = sensor_rx_data(stk->client, (char *)acc_reg, sensor->ops->read_len); in stk8baxx_read_sensor_data()
761 if (result < 0) { in stk8baxx_read_sensor_data()
762 printk(KERN_ERR "%s: failed to read acc data, error=%d\n", __func__, result); in stk8baxx_read_sensor_data()
763 return result; in stk8baxx_read_sensor_data()