All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Markus Schneider-Pargmann <msp@baylibre.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, fparent@baylibre.com,
	khilman@baylibre.com
Subject: Re: [PATCH 3/3] thermal: mediatek: add MT8365 thermal driver support
Date: Mon, 18 Oct 2021 18:03:44 +0200	[thread overview]
Message-ID: <1844fd1b-d3ff-55c1-a98e-54219c3838df@linaro.org> (raw)
In-Reply-To: <20211018154001.sj7nc575hln3jkel@blmsp>


Hi Markus,

On 18/10/2021 17:40, Markus Schneider-Pargmann wrote:

[ ... ]

>>
>>>  	}, {
>>>  	},
>>>  };
>>>  MODULE_DEVICE_TABLE(of, mtk_thermal_of_match);
>>>  
>>> -static void mtk_thermal_turn_on_buffer(void __iomem *apmixed_base)
>>> +static void mtk_thermal_turn_on_buffer(struct mtk_thermal *mt,
>>> +				       void __iomem *apmixed_base)
>>>  {
>>>  	int tmp;
>>>  
>>> -	tmp = readl(apmixed_base + APMIXED_SYS_TS_CON1);
>>> -	tmp &= ~(0x37);
>>> -	tmp |= 0x1;
>>> -	writel(tmp, apmixed_base + APMIXED_SYS_TS_CON1);
>>> +	if (!mt->conf->apmixed_buffer_ctl_reg)
>>> +		return;
>>> +
>>> +	tmp = readl(apmixed_base + mt->conf->apmixed_buffer_ctl_reg);
>>> +	tmp &= mt->conf->apmixed_buffer_ctl_mask;
>>> +	tmp |= mt->conf->apmixed_buffer_ctl_set;
>>
>> What is the goal of these two bits operations ?
> 
> mt7622 needs to unset a few bits and set one bit in this register.
> mt8365 only unsets bits. For this purpose I created a _mask field to
> unset bits and a _set field to set bits.
> 
> Would you suggest a different way?

No, I understand what you wanted to do. I was just unsure if there was a
trick because of the tmp |= 0;




-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Markus Schneider-Pargmann <msp@baylibre.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, fparent@baylibre.com,
	khilman@baylibre.com
Subject: Re: [PATCH 3/3] thermal: mediatek: add MT8365 thermal driver support
Date: Mon, 18 Oct 2021 18:03:44 +0200	[thread overview]
Message-ID: <1844fd1b-d3ff-55c1-a98e-54219c3838df@linaro.org> (raw)
In-Reply-To: <20211018154001.sj7nc575hln3jkel@blmsp>


Hi Markus,

On 18/10/2021 17:40, Markus Schneider-Pargmann wrote:

[ ... ]

>>
>>>  	}, {
>>>  	},
>>>  };
>>>  MODULE_DEVICE_TABLE(of, mtk_thermal_of_match);
>>>  
>>> -static void mtk_thermal_turn_on_buffer(void __iomem *apmixed_base)
>>> +static void mtk_thermal_turn_on_buffer(struct mtk_thermal *mt,
>>> +				       void __iomem *apmixed_base)
>>>  {
>>>  	int tmp;
>>>  
>>> -	tmp = readl(apmixed_base + APMIXED_SYS_TS_CON1);
>>> -	tmp &= ~(0x37);
>>> -	tmp |= 0x1;
>>> -	writel(tmp, apmixed_base + APMIXED_SYS_TS_CON1);
>>> +	if (!mt->conf->apmixed_buffer_ctl_reg)
>>> +		return;
>>> +
>>> +	tmp = readl(apmixed_base + mt->conf->apmixed_buffer_ctl_reg);
>>> +	tmp &= mt->conf->apmixed_buffer_ctl_mask;
>>> +	tmp |= mt->conf->apmixed_buffer_ctl_set;
>>
>> What is the goal of these two bits operations ?
> 
> mt7622 needs to unset a few bits and set one bit in this register.
> mt8365 only unsets bits. For this purpose I created a _mask field to
> unset bits and a _set field to set bits.
> 
> Would you suggest a different way?

No, I understand what you wanted to do. I was just unsure if there was a
trick because of the tmp |= 0;




-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Markus Schneider-Pargmann <msp@baylibre.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, fparent@baylibre.com,
	khilman@baylibre.com
Subject: Re: [PATCH 3/3] thermal: mediatek: add MT8365 thermal driver support
Date: Mon, 18 Oct 2021 18:03:44 +0200	[thread overview]
Message-ID: <1844fd1b-d3ff-55c1-a98e-54219c3838df@linaro.org> (raw)
In-Reply-To: <20211018154001.sj7nc575hln3jkel@blmsp>


Hi Markus,

On 18/10/2021 17:40, Markus Schneider-Pargmann wrote:

[ ... ]

>>
>>>  	}, {
>>>  	},
>>>  };
>>>  MODULE_DEVICE_TABLE(of, mtk_thermal_of_match);
>>>  
>>> -static void mtk_thermal_turn_on_buffer(void __iomem *apmixed_base)
>>> +static void mtk_thermal_turn_on_buffer(struct mtk_thermal *mt,
>>> +				       void __iomem *apmixed_base)
>>>  {
>>>  	int tmp;
>>>  
>>> -	tmp = readl(apmixed_base + APMIXED_SYS_TS_CON1);
>>> -	tmp &= ~(0x37);
>>> -	tmp |= 0x1;
>>> -	writel(tmp, apmixed_base + APMIXED_SYS_TS_CON1);
>>> +	if (!mt->conf->apmixed_buffer_ctl_reg)
>>> +		return;
>>> +
>>> +	tmp = readl(apmixed_base + mt->conf->apmixed_buffer_ctl_reg);
>>> +	tmp &= mt->conf->apmixed_buffer_ctl_mask;
>>> +	tmp |= mt->conf->apmixed_buffer_ctl_set;
>>
>> What is the goal of these two bits operations ?
> 
> mt7622 needs to unset a few bits and set one bit in this register.
> mt8365 only unsets bits. For this purpose I created a _mask field to
> unset bits and a _set field to set bits.
> 
> Would you suggest a different way?

No, I understand what you wanted to do. I was just unsure if there was a
trick because of the tmp |= 0;




-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-10-18 16:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 13:56 [PATCH 0/3] thermal: mediatek: Add mt8365 support Markus Schneider-Pargmann
2021-10-14 13:56 ` Markus Schneider-Pargmann
2021-10-14 13:56 ` Markus Schneider-Pargmann
2021-10-14 13:56 ` [PATCH 1/3] dt-bindings: thermal: mediatek: Add mt8365 Markus Schneider-Pargmann
2021-10-14 13:56   ` Markus Schneider-Pargmann
2021-10-14 13:56   ` Markus Schneider-Pargmann
2021-10-14 13:56 ` [PATCH 2/3] thermal: mediatek: Fix apmixed error message Markus Schneider-Pargmann
2021-10-14 13:56   ` Markus Schneider-Pargmann
2021-10-14 13:56   ` Markus Schneider-Pargmann
2021-10-14 13:56 ` [PATCH 3/3] thermal: mediatek: add MT8365 thermal driver support Markus Schneider-Pargmann
2021-10-14 13:56   ` Markus Schneider-Pargmann
2021-10-14 13:56   ` Markus Schneider-Pargmann
2021-10-16 20:06   ` Daniel Lezcano
2021-10-16 20:06     ` Daniel Lezcano
2021-10-16 20:06     ` Daniel Lezcano
2021-10-18 15:40     ` Markus Schneider-Pargmann
2021-10-18 15:40       ` Markus Schneider-Pargmann
2021-10-18 15:40       ` Markus Schneider-Pargmann
2021-10-18 16:03       ` Daniel Lezcano [this message]
2021-10-18 16:03         ` Daniel Lezcano
2021-10-18 16:03         ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1844fd1b-d3ff-55c1-a98e-54219c3838df@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fparent@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=msp@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.