Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754450AbaJMQLY (ORCPT ); Mon, 13 Oct 2014 12:11:24 -0400 Received: from mail-vc0-f181.google.com ([209.85.220.181]:61330 "EHLO mail-vc0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753952AbaJMQLV (ORCPT ); Mon, 13 Oct 2014 12:11:21 -0400 MIME-Version: 1.0 In-Reply-To: <1413012563-7690-2-git-send-email-caesar.wang@rock-chips.com> References: <1413012563-7690-1-git-send-email-caesar.wang@rock-chips.com> <1413012563-7690-2-git-send-email-caesar.wang@rock-chips.com> Date: Mon, 13 Oct 2014 09:11:20 -0700 X-Google-Sender-Auth: Z5eCysCjc13uTlGK2ZVK1_fEhfU Message-ID: Subject: Re: [PATCH v9 1/5] thermal: rockchip: add driver for thermal From: Doug Anderson To: Caesar Wang Cc: =?UTF-8?Q?Heiko_St=C3=BCbner?= , Zhang Rui , Eduardo Valentin , Arnd Bergmann , zyf , linux-rockchip@lists.infradead.org, "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-doc@vger.kernel.org" , Eddie Cai , Dmitry Torokhov , Derek Basehore , Tao Huang , =?UTF-8?B?6ZmI5riQ6aOe?= , Shunqian Zheng Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Caesar, On Sat, Oct 11, 2014 at 12:29 AM, Caesar Wang wrote: > +static void rk_tsadcv2_initialize(int reset_mode, int chn, void __iomem *regs, > + unsigned long hw_shut_temp) > +{ > + u32 shutdown_value; > + > + shutdown_value = rk_tsadcv2_temp_to_code(hw_shut_temp); > + > + /* Enable measurements at ~ 10 Hz */ > + writel_relaxed(0 | TSADCV2_AUTO_TSHUT_POLARITY_HIGH, regs + > + TSADCV2_AUTO_CON); > + writel_relaxed(TSADCV2_AUTO_PERIOD_TIME, regs + TSADCV2_AUTO_PERIOD); > + writel_relaxed(TSADCV2_AUTO_PERIOD_HT_TIME, regs + > + TSADCV2_AUTO_PERIOD_HT); > + writel_relaxed(shutdown_value, regs + TSADCV2_COMP_SHUT(chn)); > + writel_relaxed(TSADCV2_HIGHT_INT_DEBOUNCE_TIME, regs + > + TSADCV2_HIGHT_INT_DEBOUNCE); > + writel_relaxed(TSADCV2_HIGHT_TSHUT_DEBOUNCE_TIME, regs + > + TSADCV2_HIGHT_TSHUT_DEBOUNCE); > + > + if (reset_mode == GPIO) > + writel_relaxed(TSADCV2_SHUT_2GPIO_SRC_EN(chn) | > + TSADCV2_INT_SRC_EN(chn), regs + > + TSADCV2_INT_EN); > + else > + writel_relaxed(TSADCV2_SHUT_2CRU_SRC_EN(chn) | > + TSADCV2_INT_SRC_EN(chn) , regs + > + TSADCV2_INT_EN); > + > + writel_relaxed(TSADCV2_AUTO_SRC_EN(chn) | TSADCV2_AUTO_EN, regs + > + TSADCV2_AUTO_CON); Aren't you clobbering the polarity here? NOTE: I didn't do a full review of this driver, just noticed that while looking at another patch and figure'd I'd respond here, too. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/