<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/tty/serial/max310x.c, branch linux-5.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-07-31T05:24:30Z</updated>
<entry>
<title>tty: max310x: Fix invalid baudrate divisors calculator</title>
<updated>2019-07-31T05:24:30Z</updated>
<author>
<name>Serge Semin</name>
</author>
<published>2019-05-14T10:14:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9f9f6d50bd46785f3f21a8e01cdebb7f999d84cd'/>
<id>urn:sha1:9f9f6d50bd46785f3f21a8e01cdebb7f999d84cd</id>
<content type='text'>
[ Upstream commit 35240ba26a932b279a513f66fa4cabfd7af55221 ]

Current calculator doesn't do it' job quite correct. First of all the
max310x baud-rates generator supports the divisor being less than 16.
In this case the x2/x4 modes can be used to double or quadruple
the reference frequency. But the current baud-rate setter function
just filters all these modes out by the first condition and setups
these modes only if there is a clocks-baud division remainder. The former
doesn't seem right at all, since enabling the x2/x4 modes causes the line
noise tolerance reduction and should be only used as a last resort to
enable a requested too high baud-rate.

Finally the fraction is supposed to be calculated from D = Fref/(c*baud)
formulae, but not from D % 16, which causes the precision loss. So to speak
the current baud-rate calculator code works well only if the baud perfectly
fits to the uart reference input frequency.

Lets fix the calculator by implementing the algo fully compliant with
the fractional baud-rate generator described in the datasheet:
D = Fref / (c*baud), where c={16,8,4} is the x1/x2/x4 rate mode
respectively, Fref - reference input frequency. The divisor fraction is
calculated from the same formulae, but making sure it is found with a
resolution of 0.0625 (four bits).

Signed-off-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tty: max310x: Fix external crystal register setup</title>
<updated>2019-05-21T10:18:17Z</updated>
<author>
<name>Joe Burmeister</name>
</author>
<published>2019-05-13T10:23:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d24f455c182d5116dd5db8e1dc501115ecc9c2c'/>
<id>urn:sha1:5d24f455c182d5116dd5db8e1dc501115ecc9c2c</id>
<content type='text'>
The datasheet states:

  Bit 4: ClockEnSet the ClockEn bit high to enable an external clocking
(crystal or clock generator at XIN). Set the ClockEn bit to 0 to disable
clocking
  Bit 1: CrystalEnSet the CrystalEn bit high to enable the crystal
oscillator. When using an external clock source at XIN, CrystalEn must
be set low.

The bit 4, MAX310X_CLKSRC_EXTCLK_BIT, should be set and was not.

This was required to make the MAX3107 with an external crystal on our
board able to send or receive data.

Signed-off-by: Joe Burmeister &lt;joe.burmeister@devtank.co.uk&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Fix to avoid potential NULL pointer dereference</title>
<updated>2019-03-19T14:37:43Z</updated>
<author>
<name>Aditya Pakki</name>
</author>
<published>2019-03-18T23:44:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a10e3dd52e80b9a97a3346020024d17b2c272d6'/>
<id>urn:sha1:3a10e3dd52e80b9a97a3346020024d17b2c272d6</id>
<content type='text'>
of_match_device can return a NULL pointer when matching device is not
found. This patch avoids a scenario causing NULL pointer derefernce.

Signed-off-by: Aditya Pakki &lt;pakki001@umn.edu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Correction of the initial setting of the MODE1 bits for various supported ICs.</title>
<updated>2019-02-08T09:14:28Z</updated>
<author>
<name>Alexander Shiyan</name>
</author>
<published>2019-01-31T05:48:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f233ea4327d7b6f67a224822fdc9241a9f4e4b59'/>
<id>urn:sha1:f233ea4327d7b6f67a224822fdc9241a9f4e4b59</id>
<content type='text'>
The MODE1 register bits have different values for different ICs.
This patch corrects the initial setting of this register in accordance
with the datasheets, which will allow you to get the expected values
when debugging the driver.

Signed-off-by: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Use struct_size() in devm_kzalloc()</title>
<updated>2019-01-08T15:56:04Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2019-01-04T21:39:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=833954a4e34ed090a8e2f3b3a8d4624002f29d30'/>
<id>urn:sha1:833954a4e34ed090a8e2f3b3a8d4624002f29d30</id>
<content type='text'>
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:

struct foo {
    int stuff;
    void *entry[];
};

instance = devm_kzalloc(dev, sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:

instance = devm_kzalloc(dev, struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: pass return value of spi_register_driver</title>
<updated>2019-01-08T15:55:42Z</updated>
<author>
<name>Kangjie Lu</name>
</author>
<published>2018-12-26T01:26:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51f689cc11333944c7a457f25ec75fcb41e99410'/>
<id>urn:sha1:51f689cc11333944c7a457f25ec75fcb41e99410</id>
<content type='text'>
spi_register_driver() may fail, so let's pass its return value upstream.

Signed-off-by: Kangjie Lu &lt;kjlu@umn.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Fix tx_empty() callback</title>
<updated>2018-12-19T12:48:45Z</updated>
<author>
<name>Alexander Shiyan</name>
</author>
<published>2018-12-19T11:19:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8da3c7873ea57acb8f9cea58c0af477522965aa'/>
<id>urn:sha1:a8da3c7873ea57acb8f9cea58c0af477522965aa</id>
<content type='text'>
Function max310x_tx_empty() accesses the IRQSTS register, which is
cleared by IC when reading, so if there is an interrupt status, we
will lose it. This patch implement the transmitter check only by
the current FIFO level.

Signed-off-by: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Check the clock readiness</title>
<updated>2018-06-28T12:07:54Z</updated>
<author>
<name>Jan Kundrát</name>
</author>
<published>2018-06-08T12:27:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4cf9a888fd3c8e61509afb0d2fe0ad2170d77d9f'/>
<id>urn:sha1:4cf9a888fd3c8e61509afb0d2fe0ad2170d77d9f</id>
<content type='text'>
This chip has a diagnostics status bit informing about the state and
stability of the clock subsystem. According to the datasheet (STSint
register, bit 5, ClockReady), this bit works with the crystal
oscillator, but even without the PLL. Therefore:

- ensure that the clock check is done even when PLL is not active
- warn when the chip thinks that the clock is not ready yet

There are HW features which would let us wait asynchronously (there's a
maskable IRQ for that bit), but I think that even this simple check is a
net improvement. It would have saved me two days of debugging :).

Signed-off-by: Jan Kundrát &lt;jan.kundrat@cesnet.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>gpio: serial: max310x: Use HW type for gpio_chip's label</title>
<updated>2018-02-28T12:40:22Z</updated>
<author>
<name>Jan Kundrát</name>
</author>
<published>2018-01-26T19:02:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a9ab351fb5d68f40936233c471c53567b82fea1'/>
<id>urn:sha1:1a9ab351fb5d68f40936233c471c53567b82fea1</id>
<content type='text'>
Some debugging tools (/sys/kernel/debug/gpio, `lsgpio`) use the
gpio_chip's label for displaying an additional context. Right now, the
information duplicates stuff which is already available from the
parent's device. This is how e.g. `lsgpio`'s output looks like:

  GPIO chip: gpiochip2, "spi1.2", 16 GPIO lines

Comparing the output of other GPIO expanders that I have available:

  gpiochip4: GPIOs 464-479, parent: spi/spi1.1, mcp23s17, can sleep:
  gpiochip5: GPIOs 448-463, parent: i2c/0-0020, pca9555, can sleep:
  gpiochip2: GPIOs 496-511, parent: spi/spi1.2, spi1.2, can sleep:

This patch ensures that the type of the real HW device is shown instead
of duplicating the SPI path:

  gpiochip2: GPIOs 496-511, parent: spi/spi1.2, MAX14830, can sleep:

Signed-off-by: Jan Kundrát &lt;jan.kundrat@cesnet.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>gpio: serial: max310x: Support open-drain configuration for GPIOs</title>
<updated>2018-01-09T18:36:51Z</updated>
<author>
<name>Jan Kundrát</name>
</author>
<published>2017-12-22T20:29:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e397824bf0953344000101dc8994e92a98add0fe'/>
<id>urn:sha1:e397824bf0953344000101dc8994e92a98add0fe</id>
<content type='text'>
The push-pull vs. open-drain are the only supported output modes. The
inputs are always unconditionally equipped with weak pull-downs. That's
the only mode, so there's probably no point in exporting that. I wonder
if it's worthwhile to provide a custom dbg_show method to indicate the
current status of the outputs, though.

This patch and [1] for i2c-gpio together make it possible to bit-bang an
I2C bus over GPIOs of an UART which is connected via SPI :). Yes, this
is crazy, but it's fast enough (while on a 26Mhz SPI HW bus with a
dual-core 1.6GHz CPU) to drive an I2C bus at 200kHz, according to my
scope.

[1] https://patchwork.ozlabs.org/patch/852591/

Signed-off-by: Jan Kundrát &lt;jan.kundrat@cesnet.cz&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
