aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rtc/rtc-hym8563.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index d4a65619ef14..0f710e98538f 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -66,7 +66,7 @@
66#define HYM8563_ALM_BIT_DISABLE BIT(7) 66#define HYM8563_ALM_BIT_DISABLE BIT(7)
67 67
68#define HYM8563_CLKOUT 0x0d 68#define HYM8563_CLKOUT 0x0d
69#define HYM8563_CLKOUT_DISABLE BIT(7) 69#define HYM8563_CLKOUT_ENABLE BIT(7)
70#define HYM8563_CLKOUT_32768 0 70#define HYM8563_CLKOUT_32768 0
71#define HYM8563_CLKOUT_1024 1 71#define HYM8563_CLKOUT_1024 1
72#define HYM8563_CLKOUT_32 2 72#define HYM8563_CLKOUT_32 2
@@ -360,9 +360,9 @@ static int hym8563_clkout_control(struct clk_hw *hw, bool enable)
360 return ret; 360 return ret;
361 361
362 if (enable) 362 if (enable)
363 ret &= ~HYM8563_CLKOUT_DISABLE; 363 ret |= HYM8563_CLKOUT_ENABLE;
364 else 364 else
365 ret |= HYM8563_CLKOUT_DISABLE; 365 ret &= ~HYM8563_CLKOUT_ENABLE;
366 366
367 return i2c_smbus_write_byte_data(client, HYM8563_CLKOUT, ret); 367 return i2c_smbus_write_byte_data(client, HYM8563_CLKOUT, ret);
368} 368}
@@ -386,7 +386,7 @@ static int hym8563_clkout_is_prepared(struct clk_hw *hw)
386 if (ret < 0) 386 if (ret < 0)
387 return ret; 387 return ret;
388 388
389 return !(ret & HYM8563_CLKOUT_DISABLE); 389 return !!(ret & HYM8563_CLKOUT_ENABLE);
390} 390}
391 391
392static const struct clk_ops hym8563_clkout_ops = { 392static const struct clk_ops hym8563_clkout_ops = {
@@ -407,7 +407,7 @@ static struct clk *hym8563_clkout_register_clk(struct hym8563 *hym8563)
407 int ret; 407 int ret;
408 408
409 ret = i2c_smbus_write_byte_data(client, HYM8563_CLKOUT, 409 ret = i2c_smbus_write_byte_data(client, HYM8563_CLKOUT,
410 HYM8563_CLKOUT_DISABLE); 410 0);
411 if (ret < 0) 411 if (ret < 0)
412 return ERR_PTR(ret); 412 return ERR_PTR(ret);
413 413