Re: [PATCH v6 09/13] iio: adc: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
the new standard/hardware decides to use 0x7 for 100mA (hypothetically)? So, please use switch cases or other robust methods. -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 08/13] usb: typec: tcpci_mt6370: Add MediaTek MT6370 tcpci driver

2022-07-25 Thread Andy Shevchenko
LE_MASK : 0); Why not positive conditional? enable ? 0 : mask > +} ... > + ret = devm_add_action_or_reset(dev, mt6370_unregister_tcpci_port, > + priv->tcpci); I believe nothing bad will happen if you put it on one line. -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 07/13] mfd: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
x1E0 > + > +#define MT6370_VENID_MASK GENMASK(7, 4) > + > +#define MT6370_NUM_IRQREGS 16 > +#define MT6370_USBC_I2CADDR0x4E > +#define MT6370_REG_ADDRLEN 2 > +#define MT6370_REG_MAXADDR 0x1FF These two more logically to have near to other _REG_* definitions above. -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 08/13] usb: typec: tcpci_mt6370: Add MediaTek MT6370 tcpci driver

2022-07-18 Thread Andy Shevchenko
On Mon, Jul 18, 2022 at 10:08 AM ChiYuan Huang wrote: > On Fri, Jul 15, 2022 at 03:10:42PM +0200, Andy Shevchenko wrote: > > On Fri, Jul 15, 2022 at 1:28 PM ChiaEn Wu wrote: ... > > > This commit add support for the Type-C & Power Delivery controller in > >

Re: [PATCH v5 12/13] leds: flashlight: mt6370: Add MediaTek MT6370 flashlight support

2022-07-16 Thread Andy Shevchenko
ret = fwnode_property_read_u32(init_data->fwnode, "led-max-microamp", > + ); One line? ... > + val = clamp_align(val, MT6370_STRBTO_MIN_US, > MT6370_STRBTO_MAX_US, > + MT6370_STRBTO_STEP_US); I would name it mt6370_clamp() to avoid potential collision in the global namespace in the future. -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 11/13] leds: mt6370: Add MediaTek MT6370 current sink type LED Indicator support

2022-07-16 Thread Andy Shevchenko
"led %d, no color specified\n", > + led->index); > + return ret; return dev_err_probe(...) ; ? Ditto for many places in your entire series. > + } ... > + priv = devm_kzalloc(>dev, > + struct_size(priv, leds, count), GFP_KERNEL); At least one parameter can be placed on the previous line. > + if (!priv) > + return -ENOMEM; -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 10/13] power: supply: mt6370: Add MediaTek MT6370 charger driver

2022-07-16 Thread Andy Shevchenko
+ cancel_delayed_work_sync(>mivr_dwork); > + flush_workqueue(priv->wq); > + destroy_workqueue(priv->wq); > + mutex_destroy(>attach_lock); > + > + return ret; > +} > + > +static int mt6370_chg_remove(struct platform_device *pdev) > +{ > + struct mt6370_priv *priv = platform_get_drvdata(pdev); > + > + cancel_delayed_work_sync(>mivr_dwork); > + flush_workqueue(priv->wq); > + destroy_workqueue(priv->wq); > + mutex_destroy(>attach_lock); > + > + return 0; > +} -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 11/13] leds: mt6370: Add MediaTek MT6370 current sink type LED Indicator support

2022-07-16 Thread Andy Shevchenko
gt; > I propose, instead: > > enum mt6370_state { > STATE_OFF = 0, > STATE_KEEP, > STATE_ON, > STATE_MAX, Usually we don't put commas at the terminator entries. > }; -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 09/13] iio: adc: mt6370: Add MediaTek MT6370 support

2022-07-16 Thread Andy Shevchenko
nice to have a temporary variable struct device *dev = >dev; It will shorten some lines. > + struct mt6370_adc_data *priv; > + struct iio_dev *indio_dev; > + struct regmap *regmap; > + int ret; > +} -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 08/13] usb: typec: tcpci_mt6370: Add MediaTek MT6370 tcpci driver

2022-07-16 Thread Andy Shevchenko
ot;); > + } > + > + device_init_wakeup(dev, true); > + dev_pm_set_wake_irq(dev, priv->irq); > + > + return 0; > +} > + > +static int mt6370_tcpc_remove(struct platform_device *pdev) > +{ > + struct mt6370_priv *priv = platform_get_drvdata(pdev); > + disable_irq(priv->irq); Why? An ugly workaround due to ordering issues in ->probe()? > + tcpci_unregister_port(priv->tcpci); > + dev_pm_clear_wake_irq(>dev); > + device_init_wakeup(>dev, false); > + > + return 0; > +} -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 07/13] mfd: mt6370: Add MediaTek MT6370 support

2022-07-16 Thread Andy Shevchenko
iver, display bias > voltage supply, one general purpose LDO, and the USB Type-C & PD controller > complies with the latest USB Type-C and PD standards. FWIW, Reviewed-by: Andy Shevchenko > Signed-off-by: ChiYuan Huang > --- > v5 > > - Add the comma in the last REGM

Re: [PATCH v4 13/13] video: backlight: mt6370: Add Mediatek MT6370 support

2022-07-14 Thread Andy Shevchenko
On Thu, Jul 14, 2022 at 11:43 AM Andy Shevchenko wrote: > On Thu, Jul 14, 2022 at 11:27 AM Andy Shevchenko > wrote: > > On Thu, Jul 14, 2022 at 9:13 AM ChiaEn Wu wrote: > > > Andy Shevchenko 於 2022年7月13日 週三 晚上8:07寫道: ... > > > * prop_val = 1 --> 1

Re: [PATCH v4 13/13] video: backlight: mt6370: Add Mediatek MT6370 support

2022-07-14 Thread Andy Shevchenko
On Thu, Jul 14, 2022 at 11:47 AM Daniel Thompson wrote: > > On Thu, Jul 14, 2022 at 11:27:07AM +0200, Andy Shevchenko wrote: > > On Thu, Jul 14, 2022 at 9:13 AM ChiaEn Wu wrote: > > > I have tried two metho

Re: [PATCH v4 13/13] video: backlight: mt6370: Add Mediatek MT6370 support

2022-07-14 Thread Andy Shevchenko
On Thu, Jul 14, 2022 at 11:27 AM Andy Shevchenko wrote: > > On Thu, Jul 14, 2022 at 9:13 AM ChiaEn Wu wrote: > > Andy Shevchenko 於 2022年7月13日 週三 晚上8:07寫道: ... > > I have tried two methods

Re: [PATCH v4 13/13] video: backlight: mt6370: Add Mediatek MT6370 support

2022-07-14 Thread Andy Shevchenko
On Thu, Jul 14, 2022 at 9:13 AM ChiaEn Wu wrote: > Andy Shevchenko 於 2022年7月13日 週三 晚上8:07寫道: > > On Wed, Jul 13, 2022 at 12:53 PM ChiaEn Wu wrote: > > > Andy Shevchenko 於 2022年7月5日 週二 清晨5:14寫道: > > > > On Mon, Jul 4, 2022 at 7:43 AM ChiaEn Wu wrote: Pleas

Re: [PATCH v4 13/13] video: backlight: mt6370: Add Mediatek MT6370 support

2022-07-13 Thread Andy Shevchenko
On Wed, Jul 13, 2022 at 12:53 PM ChiaEn Wu wrote: > Andy Shevchenko 於 2022年7月5日 週二 清晨5:14寫道: > > On Mon, Jul 4, 2022 at 7:43 AM ChiaEn Wu wrote: Please, remove unneeded context when replying! ... > > > + brightness_val[0] = (brightness - 1) & >

Re: [PATCH v4 13/13] video: backlight: mt6370: Add Mediatek MT6370 support

2022-07-04 Thread Andy Shevchenko
return -EINVAL; > + } ... > +static int mt6370_bl_probe(struct platform_device *pdev) > +{ > + struct mt6370_priv *priv; > + struct backlight_properties props = { > + .type = BACKLIGHT_RAW, > + .scale = BACKLIGHT_SCALE_LINEAR, > + }; > + int ret; struct device *dev = >dev; will save you a few LoCs. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 12/13] leds: flashlight: mt6370: Add Mediatek MT6370 flashlight support

2022-07-04 Thread Andy Shevchenko
t;led_no); > + return PTR_ERR(led->v4l2_flash); > + } > + > + return 0; > +} ... > + } else > + val = clamp_align(val, MT6370_STRBTO_MINUS, > MT6370_STRBTO_MAXUS, > + MT6370_STRBTO_STEPUS); Missed {} > + > + One blank line is enough. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 10/13] power: supply: mt6370: Add Mediatek MT6370 charger driver

2022-07-04 Thread Andy Shevchenko
priv->attach = pwr_rdy; > + mutex_unlock(>attach_lock); > + > + if (!queue_work(priv->wq, >bc12_work)) > + dev_err(priv->dev, "bc12 work has already queued\n"); > + > + return 0; > +} -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 09/13] iio: adc: mt6370: Add Mediatek MT6370 support

2022-07-04 Thread Andy Shevchenko
device pointer. > +} ... > +MODULE_DESCRIPTION("MT6370 ADC Drvier"); Driver. Spell check your patches. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 07/13] mfd: mt6370: Add Mediatek MT6370 support

2022-07-04 Thread Andy Shevchenko
0, 0, "mediatek,mt6370-charger"), > + MFD_CELL_OF("backlight", NULL, NULL, 0, 0, > "mediatek,mt6370-backlight"), > + MFD_CELL_OF("flashlight", NULL, NULL, 0, 0, > "mediatek,mt6370-flashlight"), > + MFD_CELL_OF("indicator", NULL, NULL, 0, 0, > "mediatek,mt6370-indicator"), > + MFD_CELL_OF("tcpc", NULL, NULL, 0, 0, "mediatek,mt6370-tcpc"), > + MFD_CELL_RES("regulator", mt6370_regulator_irqs) Leave a comma here. > +}; -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 08/13] usb: typec: tcpci_mt6370: Add Mediatek MT6370 tcpci driver

2022-07-04 Thread Andy Shevchenko
urn dev_err_probe(dev, ...); Ditto for the rest. ... > + ret = mt6370_check_vendor_info(priv); > + if (ret) > + return dev_err_probe(>dev, ret, > + "Failed to check vendor info\n"); This duplicates (with less info given) the message from the callee. ... > + { .compatible = "mediatek,mt6370-tcpc", }, Inner comma is not needed. -- With Best Regards, Andy Shevchenko

Re: [PATCH 6/6] i2c: Make remove callback return void

2022-06-29 Thread Andy Shevchenko
rt5645.c | 4 +--- > sound/soc/codecs/rt5663.c | 4 +--- > sound/soc/codecs/rt5670.c | 4 +--- > sound/soc/codecs/rt5677.c | 4 +--- > sound/soc/codecs/rt5682

Re: [PATCH v3 09/14] regulator: mt6370: Add mt6370 DisplayBias and VibLDO support

2022-06-28 Thread Andy Shevchenko
On Fri, Jun 24, 2022 at 12:33 PM ChiaEn Wu wrote: > Andy Shevchenko 於 2022年6月24日 週五 凌晨2:19寫道: > > On Thu, Jun 23, 2022 at 2:00 PM ChiaEn Wu wrote: ... > We got a notification from Mark telling us that this patch has been > applied to git. > ( > https://lore.kernel

Re: [PATCH v3 07/14] mfd: mt6370: Add Mediatek MT6370 support

2022-06-28 Thread Andy Shevchenko
On Fri, Jun 24, 2022 at 12:19 PM ChiaEn Wu wrote: > Andy Shevchenko 於 2022年6月24日 週五 凌晨2:01寫道: > > On Thu, Jun 23, 2022 at 1:59 PM ChiaEn Wu wrote: ... > > > obj-$(CONFIG_INTEL_SOC_PMIC_BXTWC) += intel_soc_pmic_bxtwc.o > > > obj-$(CONFIG_INTEL_SOC_PMIC_CHTWC)

Re: [PATCH v3 11/14] power: supply: mt6370: Add Mediatek MT6370 charger driver

2022-06-23 Thread Andy Shevchenko
+probe_out: > + destroy_workqueue(priv->wq); > + mutex_destroy(>attach_lock); I don't see clearly the initialization of these in the ->probe(). Besides that, does destroy_workque() synchronize the actual queue(s)? Mixing devm_ and non-devm_ may lead to a wrong release order that's why it is better to see allocating and destroying resources in one function (they may be wrapped, but should be both of them, seems like you have done it only for the first parts). > + return ret; > +} ... > +static int mt6370_chg_remove(struct platform_device *pdev) > +{ > + struct mt6370_priv *priv = platform_get_drvdata(pdev); > + > + if (priv) { Can you describe when this condition can be false? > + mt6370_chg_enable_irq(priv, "mivr", false); > + cancel_delayed_work_sync(>mivr_dwork); > + destroy_workqueue(priv->wq); > + mutex_destroy(>attach_lock); > + } > + > + return 0; > +} ... > +static struct platform_driver mt6370_chg_driver = { > + .probe = mt6370_chg_probe, > + .remove = mt6370_chg_remove, > + .driver = { > + .name = "mt6370-charger", > + .of_match_table = of_match_ptr(mt6370_chg_of_match), No good use of of_match_ptr(), please drop it. > + }, > +}; -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 10/14] iio: adc: mt6370: Add Mediatek MT6370 support

2022-06-23 Thread Andy Shevchenko
!regmap) { > + dev_err(>dev, "Failed to get regmap\n"); > + return -ENODEV; return dev_err_probe(...); > + } ... > + ret = regmap_write(priv->regmap, MT6370_REG_CHG_ADC, 0); > + if (ret) { > + dev_err(>dev, "Failed to reset ADC\n"); > + return ret; > + } Ditto. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 09/14] regulator: mt6370: Add mt6370 DisplayBias and VibLDO support

2022-06-23 Thread Andy Shevchenko
"Failed to register (%d) regulator\n", i); > + return PTR_ERR(rdev); return dev_err_probe(...); ? > + } > + > + priv->rdev[i] = rdev; > + } ... > + if (!priv->regmap) { > + dev_err(>dev, "Failed to init regmap\n"); > + return -ENODEV; > + } return dev_err_probe(...); -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 08/14] usb: typec: tcpci_mt6370: Add Mediatek MT6370 tcpci driver

2022-06-23 Thread Andy Shevchenko
dev_err(>dev, "Failed to register tcpci port\n"); > + return PTR_ERR(priv->tcpci); return dev_err_probe(); ? > + } ... > + if (ret) { > + dev_err(>dev, "Failed to allocate irq (%d)\n", ret); > + tcpci_unregister_port(priv->tcpci); > + return ret; Ditto. > + } -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 07/14] mfd: mt6370: Add Mediatek MT6370 support

2022-06-23 Thread Andy Shevchenko
= u8_buf[1]; ? ... > + if (ret < 0) > + return ret; > + else if (ret != val_size) Redundant 'else'. > + return -EIO; ... > + bank_idx = *(u8 *)data; > + bank_addr = *(u8 *)(data + 1); As per above. -- With Best Regards, Andy Shevchenko

Re: [PATCH v8 01/16] clk: generalize devm_clk_get() a bit

2022-06-22 Thread Andy Shevchenko
so contained.) Even easier, you may take a message-id from the Link and supply to `b4`: b4 mbox ${message-id} mutt -f ${message-id}.mbx # or whatever MUA that handles mboxes Dunno if `b4` has capability to parse Link instead of message-id. -- With Best Regards, Andy Shevchenko

Re: [PATCH] staging: ftbft: Use backlight helper

2022-06-07 Thread Andy Shevchenko
> > Instead of manually checking the power state in struct > backlight_properties, use backlight_is_blank(). Reviewed-by: Andy Shevchenko > Signed-off-by: Stephen Kitt > Cc: Greg Kroah-Hartman > Cc: "Noralf Trønnes" > Cc: Thomas Zimmermann > Cc: Andy Shevche

Re: [PATCH 07/14] leds: flashlight: mt6370: Add Mediatek MT6370 flashlight support

2022-06-02 Thread Andy Shevchenko
On Thu, Jun 2, 2022 at 3:57 PM Andy Shevchenko wrote: > On Thu, Jun 2, 2022 at 2:07 PM szuni chen wrote: > > Andy Shevchenko 於 2022年6月1日 週三 下午5:57寫道: > > > On Tue, May 31, 2022 at 1:32 PM ChiaEn Wu wrote: ... > > > > + const char * c

Re: [PATCH 07/14] leds: flashlight: mt6370: Add Mediatek MT6370 flashlight support

2022-06-02 Thread Andy Shevchenko
On Thu, Jun 2, 2022 at 2:07 PM szuni chen wrote: > Andy Shevchenko 於 2022年6月1日 週三 下午5:57寫道: > > On Tue, May 31, 2022 at 1:32 PM ChiaEn Wu wrote: ... > > > + const char * const states[] = { "off", "keep", "on" }; >

Re: [PATCH 06/14] leds: mt6370: Add Mediatek MT6370 Indicator support

2022-06-02 Thread Andy Shevchenko
On Thu, Jun 2, 2022 at 8:27 AM ChiYuan Huang wrote: > On Wed, Jun 01, 2022 at 11:48:58AM +0200, Andy Shevchenko wrote: > > On Tue, May 31, 2022 at 1:16 PM ChiaEn Wu wrote: ... > > What indicator? > It's RGB curent sink type LED driver (maximum supported current is only 24mA).

Re: [PATCH 07/14] leds: flashlight: mt6370: Add Mediatek MT6370 flashlight support

2022-06-01 Thread Andy Shevchenko
gt; + if (!count || count > MT6370_MAX_LEDS) { > + dev_err(>dev, > + "No child node or node count over max led number %lu\n", > count); > + return -EINVAL; return dev_err_probe(...); > + } -- With Best Regards, Andy Shevchenko

Re: [PATCH 06/14] leds: mt6370: Add Mediatek MT6370 Indicator support

2022-06-01 Thread Andy Shevchenko
On Wed, Jun 1, 2022 at 11:48 AM Andy Shevchenko wrote: > On Tue, May 31, 2022 at 1:16 PM ChiaEn Wu wrote: > > > > From: Alice Chen > > All below comments are applicable to the rest of the series as well > (one way or another), so please fix all your patches where it'

Re: [PATCH 06/14] leds: mt6370: Add Mediatek MT6370 Indicator support

2022-06-01 Thread Andy Shevchenko
mt6372_tfreqs[] = { > + 8000, 4000, 2000, 1000, 500, 250, 8, 4 Ditto. > +}; -- With Best Regards, Andy Shevchenko

Re: [PATCH] staging: fbtft: fix checkpatch.pl struct should normally be const

2022-05-19 Thread Andy Shevchenko
ps), GFP_KERNEL); > + const fbops = devm_kzalloc(dev, sizeof(struct fb_ops), GFP_KERNEL); Why? -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 4/5] drm/solomon: Move device info from ssd130x-i2c to the core driver

2022-04-13 Thread Andy Shevchenko
); > MODULE_AUTHOR("Javier Martinez Canillas "); > MODULE_LICENSE("GPL v2"); > +MODULE_IMPORT_NS(DRM_SSD130X); -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 4/5] drm/solomon: Move device info from ssd130x-i2c to the core driver

2022-04-13 Thread Andy Shevchenko
sport protocols such as SPI. ... > +EXPORT_SYMBOL_GPL(ssd130x_variants); What I meant is to use EXPORT_SYMBOL_NS_GPL() here. It might require a separate patch to move other exports to that namespace first. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 4/5] drm/solomon: Move device info from ssd130x-i2c to the core driver

2022-04-12 Thread Andy Shevchenko
On Tue, Apr 12, 2022 at 02:21:08PM +0300, Andy Shevchenko wrote: > On Tue, Apr 12, 2022 at 10:07:02AM +0200, Javier Martinez Canillas wrote: > > On 4/12/22 09:23, Geert Uytterhoeven wrote: > > > On Mon, Apr 11, 2022 at 11:12 PM Javier Martinez Canillas > > > wrote:

Re: [PATCH v2 4/5] drm/solomon: Move device info from ssd130x-i2c to the core driver

2022-04-12 Thread Andy Shevchenko
is, but also with the non-NULL pointers I prefer the old style without ugly castings. Instead, you may export the array (in the driver's namespace) and use [ID] pointer for the specific device info. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 0/5] drm: Fix monochrome conversion for sdd130x

2022-04-08 Thread Andy Shevchenko
On Fri, Apr 08, 2022 at 03:54:13PM +0200, Maxime Ripard wrote: > On Fri, Mar 18, 2022 at 04:33:19PM +0200, Andy Shevchenko wrote: > > On Fri, Mar 18, 2022 at 03:21:45PM +0100, Maxime Ripard wrote: > > > On Fri, Mar 18, 2022 at 03:42:48PM +0200, Andy Shevchenko wrote: > >

Re: [PATCH v2 07/12] iio: buffer-dma: Use DMABUFs instead of custom solution

2022-03-28 Thread Andy Shevchenko
> >> + return ERR_PTR(ret); > >> + } Missed DMA mapping error check. > >> + > >> + return >sg_table; > >> +} ... > >> - /* Must not be accessed outside the core. */ > >> - struct kref kref; > >> + struct dma_buf *dmabuf; Is it okay to access outside the core? If no, why did you remove (actually not modify) the comment? -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 05/12] iio: core: Add new DMABUF interface infrastructure

2022-03-28 Thread Andy Shevchenko
gt; + * @bytes_used:number of bytes used in this DMABUF for the data > transfer. > + * If zero, the full buffer is used. Wouldn't be error prone to have 0 defined like this? -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 02/12] iio: buffer-dma: Enable buffer write support

2022-03-28 Thread Andy Shevchenko
t; +int iio_dma_buffer_write(struct iio_buffer *buffer, size_t n, > +const char __user *user_buffer) > +{ > + return iio_dma_buffer_io(buffer, n, (__force char *)user_buffer, > true); Why do you drop address space markers? > +} -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 0/5] drm: Fix monochrome conversion for sdd130x

2022-03-18 Thread Andy Shevchenko
On Fri, Mar 18, 2022 at 03:21:45PM +0100, Maxime Ripard wrote: > On Fri, Mar 18, 2022 at 03:42:48PM +0200, Andy Shevchenko wrote: > > On Thu, Mar 17, 2022 at 12:39:57PM +0100, Javier Martinez Canillas wrote: > > > On 3/17/22 09:18, Geert Uytterhoeven wrote: > > >

Re: [PATCH v2 0/5] drm: Fix monochrome conversion for sdd130x

2022-03-18 Thread Andy Shevchenko
ally work? I tried and no one replied to request. Keeping silent is a bad service. If people don't want a person to have such access it should be well communicated. -- With Best Regards, Andy Shevchenko

[PATCH v2 1/2] staging: fbtft: Constify buf parameter in fbtft_dbg_hex()

2022-03-16 Thread Andy Shevchenko
It's obvious that we don't and shouldn't modify buffer that is about to be dumped. Constify parameter in fbtft_dbg_hex() to make it clear. Fixes: c296d5f9957c ("staging: fbtft: core support") Signed-off-by: Andy Shevchenko --- v2: new patch to fix a warning (Greg) drivers/staging/f

[PATCH v2 2/2] staging: fbtft: Consider type of init sequence values in fbtft_init_display()

2022-03-16 Thread Andy Shevchenko
fbtft: Remove all strcpy() uses") Signed-off-by: Andy Shevchenko --- v2: no changes, just based on prerequisite drivers/staging/fbtft/fbtft-core.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-co

Re: [PATCH v1 1/1] staging: fbtft: Consider type of init sequence values in fbtft_init_display()

2022-03-16 Thread Andy Shevchenko
On Mon, Mar 14, 2022 at 06:28:41PM +0100, Greg Kroah-Hartman wrote: > On Fri, Mar 04, 2022 at 09:34:14PM +0200, Andy Shevchenko wrote: ... > Any reason you didn't test build this? My test build doesn't include the WERROR for this driver, so I missed the warning. Sorry for that. Now

Re: [PATCH v8 00/16] clk: provide new devm helpers for prepared and enabled clocks

2022-03-15 Thread Andy Shevchenko
clk_prepare_enable() and devm_add_action()) convinces me, that introducing the > function family is sensible. (And if you want to work on these drivers, > grepping for devm_clk_get_enabled gives you a few candidates once the > series is in :-) FWIW, Reviewed-by: Andy Shevchenko for driver

Re: [PATCH 5/5] drm/repaper: Reduce temporary buffer size in repaper_fb_dirty()

2022-03-15 Thread Andy Shevchenko
On Tue, Mar 15, 2022 at 12:07:07PM +0100, Geert Uytterhoeven wrote: > As the temporary buffer is no longer used to store 8-bit grayscale data, > its size can be reduced to the size needed to store the monochrome > bitmap data. bitmap API? -- With Best Regards, Andy Shevchenko

Re: [PATCH 4/5] drm: ssd130x: Reduce temporary buffer sizes

2022-03-15 Thread Andy Shevchenko
byte per pixel for the whole frame buffer, while it only needs to hold > one bit per pixel for the part that is to be updated. > Pass dst_pitch to drm_fb_xrgb_to_mono_reversed(), as we have already > calculated it anyway. Can we use bitmap API? bitmap_zalloc() / etc ? -- With Best Regards, Andy Shevchenko

Re: [PATCH 2/5] drm/format-helper: Fix XRGB888 to monochrome conversion

2022-03-15 Thread Andy Shevchenko
te |= BIT(i); > > } > > *dst++ = byte; > > } -- With Best Regards, Andy Shevchenko

Re: [PATCH 2/5] drm/format-helper: Fix XRGB888 to monochrome conversion

2022-03-15 Thread Andy Shevchenko
on a text console with a font > that is 8 pixels wide. > > Drop the confusing comment about scanlines, as a pitch in bytes always > contains a multiple of 8 pixels. > > While at it, use the drm_rect_height() helper instead of open-coding the > same operation. > > Update the

Re: [PATCH 1/5] drm/format-helper: Rename drm_fb_xrgb8888_to_mono_reversed()

2022-03-15 Thread Andy Shevchenko
ng. W/ or w/o the below remark being addressed Reviewed-by: Andy Shevchenko > Fixes: bcf8b616deb87941 ("drm/format-helper: Add > drm_fb_xrgb_to_mono_reversed()") > Signed-off-by: Geert Uytterhoeven > --- > drivers/gpu/drm/drm_format_helper.c | 32 ++-

Re: [PATCH v1 1/1] staging: fbtft: Consider type of init sequence values in fbtft_init_display()

2022-03-08 Thread Andy Shevchenko
On Tue, Mar 08, 2022 at 11:46:32AM +0100, Greg Kroah-Hartman wrote: > On Tue, Mar 08, 2022 at 12:18:25PM +0200, Andy Shevchenko wrote: > > +Cc: Helge > > > > Maybe you can pick this up? > > > > On Fri, Mar 04, 2022 at 09:34:14PM +0200, Andy Shevchenko wrote: &g

Re: [PATCH v1 1/1] staging: fbtft: Consider type of init sequence values in fbtft_init_display()

2022-03-08 Thread Andy Shevchenko
+Cc: Helge Maybe you can pick this up? On Fri, Mar 04, 2022 at 09:34:14PM +0200, Andy Shevchenko wrote: > In the fbtft_init_display() the init sequence is printed for > the debug purposes. Unfortunately the current code doesn't take > into account that values in the buffer are of the

[PATCH v1 1/1] staging: fbtft: Consider type of init sequence values in fbtft_init_display()

2022-03-04 Thread Andy Shevchenko
fbtft: Remove all strcpy() uses") Signed-off-by: Andy Shevchenko --- drivers/staging/fbtft/fbtft-core.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 4a35347b3020..b28a059ad

Re: [PATCH v1 1/1] drm/i915/selftests: Replace too verbose for-loop with simpler while

2022-02-15 Thread Andy Shevchenko
On Tue, Feb 15, 2022 at 07:14:49PM +0200, Jani Nikula wrote: > On Tue, 15 Feb 2022, Andy Shevchenko > wrote: > > It's hard to parse for-loop which has some magic calculations inside. > > Much cleaner to use while-loop directly. > > I assume you're trying to prove a po

[PATCH v1 1/1] drm/i915/selftests: Replace too verbose for-loop with simpler while

2022-02-15 Thread Andy Shevchenko
It's hard to parse for-loop which has some magic calculations inside. Much cleaner to use while-loop directly. Signed-off-by: Andy Shevchenko --- drivers/gpu/drm/i915/selftests/i915_syncmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915

Re: [PATCH v4 1/6] drm/format-helper: Add drm_fb_xrgb8888_to_gray8_line()

2022-02-14 Thread Andy Shevchenko
On Mon, Feb 14, 2022 at 01:12:48PM +0100, Thomas Zimmermann wrote: > Am 14.02.22 um 11:38 schrieb Andy Shevchenko: > > On Mon, Feb 14, 2022 at 10:03:53AM +0100, Thomas Zimmermann wrote: > > > Am 11.02.22 um 16:41 schrieb Andy Shevchenko: ... > > > > > IMO *alw

Re: [PATCH v4 1/6] drm/format-helper: Add drm_fb_xrgb8888_to_gray8_line()

2022-02-14 Thread Andy Shevchenko
On Mon, Feb 14, 2022 at 10:03:53AM +0100, Thomas Zimmermann wrote: > Am 11.02.22 um 16:41 schrieb Andy Shevchenko: ... > > > IMO *always* prefer a for loop over while or do-while. > > > > > > The for (i = 0; i < N; i++) is such a strong paradigm in C. You &g

Re: [PATCH v4 1/6] drm/format-helper: Add drm_fb_xrgb8888_to_gray8_line()

2022-02-14 Thread Andy Shevchenko
On Mon, Feb 14, 2022 at 11:17:11AM +0200, Pekka Paalanen wrote: > On Fri, 11 Feb 2022 19:27:12 +0200 > Andy Shevchenko wrote: > > On Fri, Feb 11, 2022 at 06:25:17PM +0200, Jani Nikula wrote: > > > On Fri, 11 Feb 2022, Andy Shevchenko > > > wrote: > > &g

Re: [PATCH] drivers: fbtft: Add property 'keep-bootlogo'

2022-02-14 Thread Andy Shevchenko
With Best Regards, Andy Shevchenko

Re: [PATCH] drivers: fbtft: Refactor backlight logic

2022-02-14 Thread Andy Shevchenko
your fbtft patches to fbdev maintainer as well. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 1/6] drm/format-helper: Add drm_fb_xrgb8888_to_gray8_line()

2022-02-11 Thread Andy Shevchenko
On Fri, Feb 11, 2022 at 06:25:17PM +0200, Jani Nikula wrote: > On Fri, 11 Feb 2022, Andy Shevchenko > wrote: > > On Fri, Feb 11, 2022 at 02:05:56PM +0200, Jani Nikula wrote: > >> On Fri, 11 Feb 2022, Thomas Zimmermann wrote: > >> > Am 11.02.22 um 12:12 schrie

Re: [PATCH v5 3/6] drm: Add driver for Solomon SSD130x OLED displays

2022-02-11 Thread Andy Shevchenko
ocate DRM device\n"); > + return ssd130x; This... > + } ... > + bl = devm_backlight_device_register(dev, dev_name(dev), dev, ssd130x, > + _bl_ops, NULL); > + if (IS_ERR(bl)) > + return ERR_PTR(dev_err_probe(dev, PTR_ERR(bl), > + "Unable to register backlight > device\n")); Can be consistent with this then. -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 2/6] drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed()

2022-02-11 Thread Andy Shevchenko
nditionals from the loop), but since it's almost a direct copy of the existing code let's improve it later on. Reviewed-by: Andy Shevchenko > Signed-off-by: Javier Martinez Canillas > Reviewed-by: Thomas Zimmermann > --- > > Changes in v5: > - Use drm_WARN_ON* macros ins

Re: [PATCH v5 1/6] drm/format-helper: Add drm_fb_xrgb8888_to_gray8_line()

2022-02-11 Thread Andy Shevchenko
critical, so Reviewed-by: Andy Shevchenko > Suggested-by: Thomas Zimmermann > Signed-off-by: Javier Martinez Canillas > Reviewed-by: Thomas Zimmermann > --- > > Changes in v5: > - Add Thomas Zimmermann's Reviewed-by to patch #1. > > Changes in v3: > - Add a drm_fb_xrgb88

Re: [PATCH v4 2/6] drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed()

2022-02-11 Thread Andy Shevchenko
On Fri, Feb 11, 2022 at 12:50:04PM +0100, Javier Martinez Canillas wrote: > On 2/11/22 12:10, Andy Shevchenko wrote: ... > >> + for (xb = 0; xb < pixels; xb++) { > >> + unsigned int start = 0, end = 8; > >> + u8 byte = 0x00; > > >

Re: [PATCH v4 3/6] drm: Add driver for Solomon SSD130x OLED displays

2022-02-11 Thread Andy Shevchenko
On Fri, Feb 11, 2022 at 01:05:57PM +0100, Javier Martinez Canillas wrote: > On 2/11/22 12:33, Andy Shevchenko wrote: > > On Fri, Feb 11, 2022 at 10:19:24AM +0100, Javier Martinez Canillas wrote: ... > >> + * Helper to write command (SSD130X_COMMAND). The fist

Re: [PATCH v4 1/6] drm/format-helper: Add drm_fb_xrgb8888_to_gray8_line()

2022-02-11 Thread Andy Shevchenko
On Fri, Feb 11, 2022 at 02:05:56PM +0200, Jani Nikula wrote: > On Fri, 11 Feb 2022, Thomas Zimmermann wrote: > > Am 11.02.22 um 12:12 schrieb Andy Shevchenko: > >> On Fri, Feb 11, 2022 at 11:40:13AM +0100, Javier Martinez Canillas wrote: > >>> On 2/11/2

Re: [PATCH v4 6/6] dt-bindings: display: ssd1307fb: Add myself as binding co-maintainer

2022-02-11 Thread Andy Shevchenko
ther maintainer of the binding, to make sure that I will > be on Cc when patches are proposed for it. Reviewed-by: Andy Shevchenko > Suggested-by: Sam Ravnborg > Signed-off-by: Javier Martinez Canillas > Acked-by: Rob Herring > --- > > Changes in v4: > - Add Rob Herring Acked-

Re: [PATCH v4 5/6] MAINTAINERS: Add entry for Solomon SSD130x OLED displays DRM driver

2022-02-11 Thread Andy Shevchenko
nce the new DRM driver was made compatible with the existing binding. Reviewed-by: Andy Shevchenko > Signed-off-by: Javier Martinez Canillas > Acked-by: Sam Ravnborg > --- > > (no changes since v3) > > Changes in v3: > - Adapt MAINTAINERS entry to point to the n

Re: [PATCH v4 3/6] drm: Add driver for Solomon SSD130x OLED displays

2022-02-11 Thread Andy Shevchenko
k; > + } > + data_array[array_idx++] = data; > + } > + } ... > + bl = devm_backlight_device_register(dev, dev_name(dev), dev, ssd130x, > + _bl_ops, NULL); > + if (IS_ERR(bl)) { > + ret = PTR_ERR(bl); > + dev_err_probe(dev, ret, "Unable to register backlight > device\n"); > + return ERR_PTR(ret); dev_err_probe(dev, PTR_ERR(bl), "Unable to register backlight device\n"); return bl; ? > + } -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 4/6] drm/solomon: Add SSD130x OLED displays I2C support

2022-02-11 Thread Andy Shevchenko
On Fri, Feb 11, 2022 at 10:19:25AM +0100, Javier Martinez Canillas wrote: > The ssd130x driver only provides the core support for these devices but it > does not have any bus transport logic. Add a driver to interface over I2C. Reviewed-by: Andy Shevchenko > Signed-off-by: Javier

Re: [PATCH v4 1/6] drm/format-helper: Add drm_fb_xrgb8888_to_gray8_line()

2022-02-11 Thread Andy Shevchenko
On Fri, Feb 11, 2022 at 11:40:13AM +0100, Javier Martinez Canillas wrote: > On 2/11/22 11:28, Andy Shevchenko wrote: > > On Fri, Feb 11, 2022 at 10:19:22AM +0100, Javier Martinez Canillas wrote: ... > >> +static void drm_fb_xrgb_to_gray8_line(u8 *dst, const u32 *src,

Re: [PATCH v4 2/6] drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed()

2022-02-11 Thread Andy Shevchenko
art and end pixels that > + * are not aligned to multiple of 8. > + * > + * Calculate if the start and end pixels are not aligned and set the > + * offsets for the reversed mono line conversion function to adjust. > + */ > + start_offset = clip->x1 % 8; > + end_len = clip->x2 % 8; ALIGN() ? -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 1/6] drm/format-helper: Add drm_fb_xrgb8888_to_gray8_line()

2022-02-11 Thread Andy Shevchenko
8 b = *src & 0x00ff; > + > + /* ITU BT.601: Y = 0.299 R + 0.587 G + 0.114 B */ > + *dst++ = (3 * r + 6 * g + b) / 10; > + src++; > + } Can be done as while (pixels--) { ... } or do {

Re: [PATCH 2/2] fbdev: Don't sort deferred-I/O pages by default

2022-02-10 Thread Andy Shevchenko
% > > With unsorted page lists: > > BENCHMARKs: VC: 31.005s VO: 42.889s A: 0.000s Sys: 2.256s = 76.150s > BENCHMARK%: VC: 40.7156% VO: 56.3219% A: 0.% Sys: 2.9625% = 100.% > > VC shows the overhead of video decoding, VO shows the overhead of the > vide

Re: [PATCH v3 3/7] drm: Add driver for Solomon SSD130X OLED displays

2022-02-09 Thread Andy Shevchenko
On Wed, Feb 09, 2022 at 05:26:00PM +0100, Javier Martinez Canillas wrote: > On 2/9/22 17:08, Andy Shevchenko wrote: ... > On that topic, I even typed a SPI driver because of your feedback :) Much appreciated, makes me much easier to test. Thank you for doing all this! -- With Best R

Re: [PATCH v3 5/7] (WIP) drm/solomon: Add SSD130X OLED displays SPI support

2022-02-09 Thread Andy Shevchenko
different buses, can't clash). -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 5/7] (WIP) drm/solomon: Add SSD130X OLED displays SPI support

2022-02-09 Thread Andy Shevchenko
On Wed, Feb 09, 2022 at 05:07:03PM +0100, Javier Martinez Canillas wrote: > On 2/9/22 16:17, Andy Shevchenko wrote: > > On Wed, Feb 09, 2022 at 01:25:46PM +0100, Geert Uytterhoeven wrote: > >> On Wed, Feb 9, 2022 at 10:12 AM Javier Martinez Ca

Re: [PATCH v3 3/7] drm: Add driver for Solomon SSD130X OLED displays

2022-02-09 Thread Andy Shevchenko
On Wed, Feb 09, 2022 at 04:54:01PM +0100, Javier Martinez Canillas wrote: > On 2/9/22 16:12, Andy Shevchenko wrote: > > On Wed, Feb 09, 2022 at 10:03:10AM +0100, Javier Martinez Canillas wrote: ... > >> + do { > >> + value = va_arg(ap, int); > >> +

Re: [PATCH v2 0/4] drm/tiny: Add driver for Solomon SSD1307 OLED displays

2022-02-09 Thread Andy Shevchenko
urrection discussion I can send a new version to unorphan it, route via fbdev, and leave under staging, so it will be a compromise between all stakeholders. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 5/7] (WIP) drm/solomon: Add SSD130X OLED displays SPI support

2022-02-09 Thread Andy Shevchenko
body keep an eye each rc cycle. It might take time to return it in shape first. *) Speaking out of my own experience with device(s) that I possess. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 5/7] (WIP) drm/solomon: Add SSD130X OLED displays SPI support

2022-02-09 Thread Andy Shevchenko
may be a good time to deprecate the existing > "solomon,ssd130*fb-i2c" compatible values, and switch to > "solomon,ssd130*fb" instead, for both I2C and SPI. Agree! > Of course the I2C subdriver still has to bind against the old values, > too, for backwards compatibility. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 5/7] (WIP) drm/solomon: Add SSD130X OLED displays SPI support

2022-02-09 Thread Andy Shevchenko
h Best Regards, Andy Shevchenko

Re: [PATCH v3 4/7] drm/solomon: Add SSD130X OLED displays I2C support

2022-02-09 Thread Andy Shevchenko
illas s?! ... > +#include > +#include regmap.h ? err.h? ... > + ssd130x = ssd130x_probe(>dev, regmap); > + Redundant blank line. > + if (IS_ERR(ssd130x)) > + return PTR_ERR(ssd130x); ... > + { /* sentinel */ }, No comma for terminator entry. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 3/7] drm: Add driver for Solomon SSD130X OLED displays

2022-02-09 Thread Andy Shevchenko
return ssd130x; return dev_err_probe() ? > + } ... > + bl = devm_backlight_device_register(dev, dev_name(dev), dev, ssd130x, > + _bl_ops, NULL); > + if (IS_ERR(bl)) { > + ret = PTR_ERR(bl); > + dev_err(dev, "Unable to register backlight device: %d\n", ret); > + return ERR_PTR(ret); Ditto. > + } ... > + ret = drm_dev_register(drm, 0); > + if (ret) { > + dev_err(dev, "DRM device register failed: %d\n", ret); > + return ERR_PTR(ret); Ditto. > + } ... I have feelings that half of my comments were ignored... Maybe I missed the discussion(s). -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 0/4] drm/tiny: Add driver for Solomon SSD1307 OLED displays

2022-02-09 Thread Andy Shevchenko
, Geert, for testing and reporting this issue in particular. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 2/4] drm/tiny: Add driver for Solomon SSD130X OLED displays

2022-02-05 Thread Andy Shevchenko
On Fri, Feb 04, 2022 at 08:19:12PM +0100, Javier Martinez Canillas wrote: > On 2/4/22 15:26, Andy Shevchenko wrote: > > On Fri, Feb 04, 2022 at 02:43:45PM +0100, Javier Martinez Canillas wrote: ... > >> +struct ssd130x_device { > >> + struct drm

Re: [PATCH v2 3/4] MAINTAINERS: Add entry for Solomon SSD130X OLED displays DRM driver

2022-02-04 Thread Andy Shevchenko
On Fri, Feb 04, 2022 at 03:12:17PM +0100, Javier Martinez Canillas wrote: > On 2/4/22 14:57, Andy Shevchenko wrote: > > On Fri, Feb 04, 2022 at 02:43:46PM +0100, Javier Martinez Canillas wrote: ... > > Stray change? > > Sigh, I'm not sure how added that change. Jus

Re: [PATCH v2 2/4] drm/tiny: Add driver for Solomon SSD130X OLED displays

2022-02-04 Thread Andy Shevchenko
et = PTR_ERR(bl); > + dev_err(dev, "Unable to register backlight device: %d\n", ret); > + return ret; return dev_err_probe(); > + } ... > + ret = drm_dev_register(drm, 0); > + if (ret) { > + dev_err(dev, "DRM device register failed: %d\n", ret); > + return ret; > + } Ditto. ... > + {}, Comma is not needed in terminator entry. ... > +static struct i2c_driver ssd130x_i2c_driver = { > + .driver = { > + .name = DRIVER_NAME, > + .of_match_table = ssd130x_of_match, > + }, > + .probe_new = ssd130x_probe, > + .remove = ssd130x_remove, > + .shutdown = ssd130x_shutdown, > +}; > + Redundant blank line. > +module_i2c_driver(ssd130x_i2c_driver); -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 3/4] MAINTAINERS: Add entry for Solomon SSD130X OLED displays DRM driver

2022-02-04 Thread Andy Shevchenko
nce the new DRM driver was made compatible with the existing binding. ... > drivers/gpu/drm/drm_format_helper.c | 2 +- Nothing about this in the commit message... Stray change? -- With Best Regards, Andy Shevchenko

Re: [PATCH 0/4] drm/tiny: Add driver for Solomon SSD1307 OLED displays

2022-02-02 Thread Andy Shevchenko
On Wed, Feb 02, 2022 at 12:54:32PM +0100, Javier Martinez Canillas wrote: > On 2/2/22 12:50, Andy Shevchenko wrote: > >> What's your suggestion then to solve the issue mentioned above ? With my > >> distro > >> maintainer hat I don't care that much, since the fbdev

Re: [PATCH 0/4] drm/tiny: Add driver for Solomon SSD1307 OLED displays

2022-02-02 Thread Andy Shevchenko
On Wed, Feb 02, 2022 at 12:39:29PM +0100, Javier Martinez Canillas wrote: > On 2/2/22 12:06, Andy Shevchenko wrote: > > On Wed, Feb 02, 2022 at 09:38:51AM +0100, Javier Martinez Canillas wrote: > >> On 2/1/22 21:40, Sam Ravnborg wrote: > > And how will distros c

<    1   2   3   4   5   6   7   8   9   10   >