Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-25 Thread Ondřej Jirman
Hello Yangtao, On Sun, May 26, 2019 at 02:48:13AM +0800, Frank Lee wrote: > On Sun, May 19, 2019 at 10:22 PM Ondřej Jirman wrote: > > > > I know, I don't think it needs to be per-soc. These actions are all shared > > by > > all SoCs. Maybe with an exception that some SoCs may need one more clock

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-25 Thread Vasily Khoruzhick
On Sat, May 25, 2019 at 11:48 AM Frank Lee wrote: > > HI Ondřej, > > On Sun, May 19, 2019 at 10:22 PM Ondřej Jirman wrote: > > > > Hello Yangtao, > > > > On Sat, May 18, 2019 at 12:34:57AM +0800, Frank Lee wrote: > > > HI, > > > > > > On Fri, May 17, 2019 at 2:29 AM Ondřej Jirman wrote: > > > >

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-25 Thread Frank Lee
HI, Following the discussion above, I made some changes. I think it's time to consider V3 and see what else needs to be modified. Thx, Yangtao

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-25 Thread Frank Lee
HI Ondřej, On Sun, May 19, 2019 at 10:22 PM Ondřej Jirman wrote: > > Hello Yangtao, > > On Sat, May 18, 2019 at 12:34:57AM +0800, Frank Lee wrote: > > HI, > > > > On Fri, May 17, 2019 at 2:29 AM Ondřej Jirman wrote: > > > > > > Hi Yangtao, > > > > > > thank you for work on this driver. > > > > >

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-21 Thread Ondřej Jirman
On Tue, May 21, 2019 at 04:27:34PM +0200, Maxime Ripard wrote: > On Tue, May 21, 2019 at 12:27:21PM +0200, Ondřej Jirman wrote: > > On Tue, May 21, 2019 at 10:05:15AM +0200, Maxime Ripard wrote: > > > On Sat, May 18, 2019 at 01:27:39AM +0800, Frank Lee wrote: > > > > On Fri, May 17, 2019 at 3:36 PM

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-21 Thread Maxime Ripard
On Tue, May 21, 2019 at 12:27:21PM +0200, Ondřej Jirman wrote: > On Tue, May 21, 2019 at 10:05:15AM +0200, Maxime Ripard wrote: > > On Sat, May 18, 2019 at 01:27:39AM +0800, Frank Lee wrote: > > > On Fri, May 17, 2019 at 3:36 PM Maxime Ripard > > > wrote: > > > > > > > > On Fri, May 17, 2019 at 0

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-21 Thread Ondřej Jirman
Hi Maxime, On Tue, May 21, 2019 at 10:05:15AM +0200, Maxime Ripard wrote: > On Sat, May 18, 2019 at 01:27:39AM +0800, Frank Lee wrote: > > On Fri, May 17, 2019 at 3:36 PM Maxime Ripard > > wrote: > > > > > > On Fri, May 17, 2019 at 01:51:56AM +0800, Frank Lee wrote: > > > > > > +struct sun50i_th

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-21 Thread Maxime Ripard
On Sat, May 18, 2019 at 01:27:39AM +0800, Frank Lee wrote: > On Fri, May 17, 2019 at 3:36 PM Maxime Ripard > wrote: > > > > On Fri, May 17, 2019 at 01:51:56AM +0800, Frank Lee wrote: > > > > > +struct sun50i_thermal_chip { > > > > > + int sensor_num; > > > > > + int offset; > > >

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-21 Thread Maxime Ripard
On Fri, May 17, 2019 at 12:21:57PM -0700, Vasily Khoruzhick wrote: > On Sun, May 12, 2019 at 6:39 AM Maxime Ripard > wrote: > > > +static int tsens_get_temp(void *data, int *temp) > > > +{ > > > + struct tsensor *s = data; > > > + struct tsens_device *tmdev = s->tmdev; > > > + int val

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-21 Thread Maxime Ripard
Hi, On Sat, May 18, 2019 at 01:19:54AM +0800, Frank Lee wrote: > On Fri, May 17, 2019 at 3:32 PM Maxime Ripard > wrote: > > > > On Fri, May 17, 2019 at 02:10:47AM +0800, Frank Lee wrote: > > > > On Sun, May 12, 2019 at 11:41:28PM +0200, Ondřej Jirman wrote: > > > > > > > +static int tsens_get_te

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-20 Thread Maxime Ripard
On Sun, May 19, 2019 at 04:22:39PM +0200, Ondřej Jirman wrote: > On Sat, May 18, 2019 at 12:34:57AM +0800, Frank Lee wrote: > > HI, > > > > On Fri, May 17, 2019 at 2:29 AM Ondřej Jirman wrote: > > > > > > Hi Yangtao, > > > > > > thank you for work on this driver. > > > > > > On Fri, May 17, 2019 a

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-19 Thread Ondřej Jirman
Hello Yangtao, On Sat, May 18, 2019 at 12:34:57AM +0800, Frank Lee wrote: > HI, > > On Fri, May 17, 2019 at 2:29 AM Ondřej Jirman wrote: > > > > Hi Yangtao, > > > > thank you for work on this driver. > > > > On Fri, May 17, 2019 at 02:06:53AM +0800, Frank Lee wrote: > > > HI Ondřej, > > > > > >

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-17 Thread Vasily Khoruzhick
On Sun, May 12, 2019 at 6:39 AM Maxime Ripard wrote: > > Hi, > > Thanks a lot for working on this! > > On Sun, May 12, 2019 at 04:26:13AM -0400, Yangtao Li wrote: > > This patch adds the support for allwinner thermal sensor, within > > allwinner SoC. It will register sensors for thermal framework

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-17 Thread Frank Lee
On Fri, May 17, 2019 at 3:36 PM Maxime Ripard wrote: > > On Fri, May 17, 2019 at 01:51:56AM +0800, Frank Lee wrote: > > > > +struct sun50i_thermal_chip { > > > > + int sensor_num; > > > > + int offset; > > > > + int scale; > > > > + int ft_deviation; > > > > + i

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-17 Thread Frank Lee
On Fri, May 17, 2019 at 3:32 PM Maxime Ripard wrote: > > On Fri, May 17, 2019 at 02:10:47AM +0800, Frank Lee wrote: > > > On Sun, May 12, 2019 at 11:41:28PM +0200, Ondřej Jirman wrote: > > > > > > +static int tsens_get_temp(void *data, int *temp) > > > > > > +{ > > > > > > + struct tsensor *s = da

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-17 Thread Frank Lee
HI, On Fri, May 17, 2019 at 2:29 AM Ondřej Jirman wrote: > > Hi Yangtao, > > thank you for work on this driver. > > On Fri, May 17, 2019 at 02:06:53AM +0800, Frank Lee wrote: > > HI Ondřej, > > > > On Mon, May 13, 2019 at 6:16 AM Ondřej Jirman wrote: > > > > + > > > > +/* Temp Unit: millidegree

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-17 Thread Maxime Ripard
On Fri, May 17, 2019 at 01:51:56AM +0800, Frank Lee wrote: > > > +struct sun50i_thermal_chip { > > > + int sensor_num; > > > + int offset; > > > + int scale; > > > + int ft_deviation; > > > + int temp_calib_base; > > > + int temp_data_base; > > > +

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-17 Thread Maxime Ripard
On Fri, May 17, 2019 at 02:10:47AM +0800, Frank Lee wrote: > > On Sun, May 12, 2019 at 11:41:28PM +0200, Ondřej Jirman wrote: > > > > > +static int tsens_get_temp(void *data, int *temp) > > > > > +{ > > > > > + struct tsensor *s = data; > > > > > + struct tsens_device *tmdev = s->tmdev; > > > > > +

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-16 Thread Ondřej Jirman
Hello, On Fri, May 17, 2019 at 01:51:56AM +0800, Frank Lee wrote: > > > +static int tsens_probe(struct platform_device *pdev) > > > +{ > > > + struct tsens_device *tmdev; > > > + struct device *dev = &pdev->dev; > > > + int ret; > > > + > > > + tmdev = devm_kzalloc(dev, sizeof(*tmd

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-16 Thread Ondřej Jirman
Hi Yangtao, thank you for work on this driver. On Fri, May 17, 2019 at 02:06:53AM +0800, Frank Lee wrote: > HI Ondřej, > > On Mon, May 13, 2019 at 6:16 AM Ondřej Jirman wrote: > > > + > > > +/* Temp Unit: millidegree Celsius */ > > > +static int tsens_reg2temp(struct tsens_device *tmdev, > > >

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-16 Thread Frank Lee
On Thu, May 16, 2019 at 11:03 PM Maxime Ripard wrote: > > Hi, > > On Sun, May 12, 2019 at 11:41:28PM +0200, Ondřej Jirman wrote: > > > > +static int tsens_get_temp(void *data, int *temp) > > > > +{ > > > > + struct tsensor *s = data; > > > > + struct tsens_device *tmdev = s->tmdev; > > > > + int v

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-16 Thread Frank Lee
Hi Ondřej, On Mon, May 13, 2019 at 6:39 AM Ondřej Jirman wrote: > > On Sun, May 12, 2019 at 04:26:13AM -0400, Yangtao Li wrote: > > This patch adds the support for allwinner thermal sensor, within > > allwinner SoC. It will register sensors for thermal framework > > and use device tree to bind co

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-16 Thread Frank Lee
HI Ondřej, On Mon, May 13, 2019 at 6:16 AM Ondřej Jirman wrote: > > Hello Yangtao, > > On Sun, May 12, 2019 at 04:26:13AM -0400, Yangtao Li wrote: > > diff --git a/drivers/thermal/sun50i_thermal.c > > b/drivers/thermal/sun50i_thermal.c > > new file mode 100644 > > index ..3bdb3677b3d

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-16 Thread Frank Lee
HI Maxime, On Sun, May 12, 2019 at 9:39 PM Maxime Ripard wrote: > > Hi, > > Thanks a lot for working on this! > > On Sun, May 12, 2019 at 04:26:13AM -0400, Yangtao Li wrote: > > This patch adds the support for allwinner thermal sensor, within > > allwinner SoC. It will register sensors for therma

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-16 Thread Ondřej Jirman
Hello Maxime, On Thu, May 16, 2019 at 05:02:52PM +0200, Maxime Ripard wrote: > Hi, > > On Sun, May 12, 2019 at 11:41:28PM +0200, Ondřej Jirman wrote: > > > > +static int tsens_get_temp(void *data, int *temp) > > > > +{ > > > > + struct tsensor *s = data; > > > > + struct tsens_device

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-16 Thread Maxime Ripard
Hi, On Sun, May 12, 2019 at 11:41:28PM +0200, Ondřej Jirman wrote: > > > +static int tsens_get_temp(void *data, int *temp) > > > +{ > > > + struct tsensor *s = data; > > > + struct tsens_device *tmdev = s->tmdev; > > > + int val; > > > + > > > + regmap_read(tmdev->regmap, tmdev->chip->temp_data_ba

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-13 Thread Maxime Ripard
On Mon, May 13, 2019 at 12:39:55AM +0200, Ondřej Jirman wrote: > > + /* > > +* clkin = 24MHz > > +* T acquire = clkin / (SUN50I_THS_CTRL0_T_ACQ + 1) > > +* = 20us > > +*/ > > + regmap_write(tmdev->regmap, SUN50I_THS_CTRL0, > > +SUN50I_THS_CTRL0_T_ACQ(47

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-12 Thread Ondřej Jirman
On Sun, May 12, 2019 at 04:26:13AM -0400, Yangtao Li wrote: > This patch adds the support for allwinner thermal sensor, within > allwinner SoC. It will register sensors for thermal framework > and use device tree to bind cooling device. > > Based on driver code found here: > https://megous.com/git

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-12 Thread Ondřej Jirman
Hello Yangtao, On Sun, May 12, 2019 at 04:26:13AM -0400, Yangtao Li wrote: > diff --git a/drivers/thermal/sun50i_thermal.c > b/drivers/thermal/sun50i_thermal.c > new file mode 100644 > index ..3bdb3677b3d4 > --- /dev/null > +++ b/drivers/thermal/sun50i_thermal.c > @@ -0,0 +1,357 @@ >

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-12 Thread Ondřej Jirman
Hello Maxime, On Sun, May 12, 2019 at 03:39:30PM +0200, Maxime Ripard wrote: > Hi, > > Thanks a lot for working on this! > > On Sun, May 12, 2019 at 04:26:13AM -0400, Yangtao Li wrote: > > This patch adds the support for allwinner thermal sensor, within > > allwinner SoC. It will register sensor

Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6

2019-05-12 Thread Maxime Ripard
Hi, Thanks a lot for working on this! On Sun, May 12, 2019 at 04:26:13AM -0400, Yangtao Li wrote: > This patch adds the support for allwinner thermal sensor, within > allwinner SoC. It will register sensors for thermal framework > and use device tree to bind cooling device. > > Based on driver co