Commit 3a5e9a35 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk Committed by Adam Wujek

libwr: cleanup in log messages - logs and content

parent 804afb15
......@@ -200,8 +200,7 @@ static float tmp100_read_temp(int dev_addr)
static int shw_init_i2c_sensors(void)
{
if (i2c_init_bus(&fpga_sensors_i2c) < 0) {
pr_error(
"can't initialize temperature sensors I2C bus.\n");
pr_error("Can't initialize temperature sensors I2C bus.\n");
return -1;
}
return 0;
......@@ -266,7 +265,7 @@ int shw_init_fans(void)
config_item = libwr_cfg_get("FAN_HYSTERESIS");
if ((config_item) && !strcmp(config_item, "y")) {
fan_hysteresis = 1;
pr_info("enable fan hysteresis\n");
pr_info("Enabling fan hysteresis\n");
config_item = libwr_cfg_get("FAN_HYSTERESIS_T_ENABLE");
if (config_item) {
fan_hysteresis_t_enable = atoi(config_item);
......@@ -290,11 +289,11 @@ int shw_init_fans(void)
fan_hysteresis_pwm_val = 4;
}
pr_info("set temp enable to %d for fan hysteresis\n",
fan_hysteresis_t_enable);
pr_info("set temp disable to %d for fan hysteresis\n",
fan_hysteresis_t_disable);
pr_info("set pwm value to %d for fan hysteresis\n",
pr_info("Setting upper temperature threshold to %d for fan "
"hysteresis\n", fan_hysteresis_t_enable);
pr_info("Setting lower temperature threshold to %d for fan "
"hysteresis\n", fan_hysteresis_t_disable);
pr_info("Setting pwm value to %d for fan hysteresis\n",
fan_hysteresis_pwm_val);
}
......
......@@ -25,7 +25,7 @@ int shw_fpga_mmap_init()
{
int fd;
pr_info("Initializing FPGA memory mapping.\n");
pr_debug("Initializing FPGA memory mapping.\n");
fd = open("/dev/mem", O_RDWR | O_SYNC);
if (fd < 0) {
......@@ -42,7 +42,7 @@ int shw_fpga_mmap_init()
return -1;
}
pr_info("FPGA virtual base = %p\n", _fpga_base_virt);
pr_debug("FPGA virtual base = %p\n", _fpga_base_virt);
return 0;
......
......@@ -70,6 +70,6 @@ int32_t i2c_scan(struct i2c_bus * bus, uint8_t * data)
found++;
}
}
pr_info("%s (%p): ndev=%d\n", bus->name, bus, found);
pr_debug("%s (%p): ndev=%d\n", bus->name, bus, found);
return found;
}
......@@ -24,7 +24,7 @@ int i2c_bitbang_init_bus(struct i2c_bus *bus)
priv = (struct i2c_bitbang *)bus->type_specific;
pr_info("init: %s (%p)\n", bus->name, bus);
pr_debug("init: %s (%p)\n", bus->name, bus);
shw_pio_configure(priv->scl);
shw_pio_configure(priv->sda);
shw_pio_setdir(priv->scl, 0);
......
......@@ -68,13 +68,12 @@ struct i2c_bus i2c_io_bus = {
int shw_i2c_io_init(void)
{
pr_info("Initializing IO I2C bus...%s\n", __TIME__);
if (i2c_init_bus(&i2c_io_bus) < 0) {
pr_error("init failed: %s\n", i2c_io_bus.name);
pr_error("I2C I/O init failed for bus %s\n", i2c_io_bus.name);
return -1;
}
pr_info("init: success: %s\n", i2c_io_bus.name);
pr_info("I2C I/O init success for bus %s\n", i2c_io_bus.name);
return 0;
}
......@@ -112,9 +111,8 @@ int shw_get_hw_ver(void)
case 2:
return 341;
default:
pr_error(
"Unknown HW version (0x%x), check the DIP switch under the SCB\n",
(ret >> 1) & 0x7);
pr_error("Unknown HW version (0x%x), check the DIP "
"switch under the SCB\n", (ret >> 1) & 0x7);
return -1;
}
......
......@@ -194,7 +194,8 @@ int shw_sfp_buses_init(void)
pr_info("Initializing SFP I2C busses...\n");
for (i = 0; i < ARRAY_SIZE(i2c_buses); i++) {
if (i2c_init_bus(&i2c_buses[i]) < 0) {
pr_error("init failed: %s\n", i2c_buses[i].name);
pr_error("I2C SFP init failed for bus %s\n",
i2c_buses[i].name);
return -1;
}
// printf("init: success: %s\n", i2c_buses[i].name);
......
......@@ -10,7 +10,7 @@
int shw_init()
{
pr_info("%s\n======================================================\n",
pr_debug("%s\n======================================================\n",
__TIME__);
/* Init input/output (GPIO & CPU I2C) */
......@@ -37,6 +37,6 @@ int shw_init()
int shw_exit_fatal(void)
{
pr_error("exiting due to fatal error.\n");
pr_error("Exiting due to fatal error.\n");
exit(-1);
}
......@@ -48,12 +48,12 @@ int shw_pio_mmap_init()
AT91C_BASE_SYS_RAW);
if (_sys_base == NULL) {
pr_error("Can't mmap CPU GPIO regs\n");
pr_error("Can't mmap CPU GPIO registers\n");
close(fd);
exit(-1);
}
pr_info("AT91_SYS virtual base = %p\n", _sys_base);
pr_debug("AT91_SYS virtual base = %p\n", _sys_base);
pmc_enable_clock(2); /* enable PIO clocks */
pmc_enable_clock(3);
......
......@@ -112,7 +112,7 @@ int shw_io_init()
I2C_shw_io_led_state_o);
}
pr_info("version=%d (CPUPWN=%d)\n", ver, ver < 330);
pr_info("Hardware version is %d (CPUPWN=%d)\n", ver, ver < 330);
return 0;
}
......@@ -140,7 +140,7 @@ int shw_io_configure_all()
//Do nothing for undefined type
break;
default:
pr_info(
pr_debug(
"Config not implemented for type %d for io #%d\n",
io->type, i);
break;
......@@ -192,7 +192,7 @@ uint32_t shw_io_read(shw_io_id_t id)
shift);
}
case SHW_UNDEF:
pr_error( "IO #%d is undef\n", id);
pr_error( "IO #%d is undefined\n", id);
break;
default:
pr_error( "Unknow type %d for io #%d\n",
......@@ -232,7 +232,7 @@ int shw_io_write(shw_io_id_t id, uint32_t value)
i32data);
}
case SHW_UNDEF:
pr_error( "Pin #%d is undef\n", id);
pr_error( "Pin #%d is undefined\n", id);
break;
default:
pr_error( "Unknow type %d for io #%d\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment