#ifndef __ATMEL_PDMIC_H_
#define __ATMEL_PDMIC_H_

#include <linux/bitops.h>

#define PDMIC_CR	0x00000000

#define PDMIC_CR_SWRST		0x1
#define PDMIC_CR_SWRST_MASK	BIT(0)
#define PDMIC_CR_SWRST_SHIFT	(0)

#define PDMIC_CR_ENPDM_DIS	0x0
#define PDMIC_CR_ENPDM_EN	0x1
#define PDMIC_CR_ENPDM_MASK	BIT(4)
#define PDMIC_CR_ENPDM_SHIFT	(4)

#define PDMIC_MR	0x00000004

#define PDMIC_MR_CLKS_PCK	0x0
#define PDMIC_MR_CLKS_GCK	0x1
#define PDMIC_MR_CLKS_MASK	BIT(4)
#define PDMIC_MR_CLKS_SHIFT	(4)

#define PDMIC_MR_PRESCAL_MASK	GENMASK(14, 8)
#define PDMIC_MR_PRESCAL_SHIFT	(8)

#define PDMIC_CDR	0x00000014

#define PDMIC_IER	0x00000018
#define PDMIC_IER_OVRE			BIT(25)

#define PDMIC_IDR	0x0000001c
#define PDMIC_IDR_OVRE			BIT(25)

#define PDMIC_IMR	0x00000020

#define PDMIC_ISR	0x00000024
#define PDMIC_ISR_OVRE			BIT(25)

#define PDMIC_DSPR0	0x00000058

#define PDMIC_DSPR0_HPFBYP_DIS		0x1
#define PDMIC_DSPR0_HPFBYP_EN		0x0
#define PDMIC_DSPR0_HPFBYP_MASK		BIT(1)
#define PDMIC_DSPR0_HPFBYP_SHIFT	(1)

#define PDMIC_DSPR0_SINBYP_DIS		0x1
#define PDMIC_DSPR0_SINBYP_EN		0x0
#define PDMIC_DSPR0_SINBYP_MASK		BIT(2)
#define PDMIC_DSPR0_SINBYP_SHIFT	(2)

#define PDMIC_DSPR0_SIZE_16_BITS	0x0
#define PDMIC_DSPR0_SIZE_32_BITS	0x1
#define PDMIC_DSPR0_SIZE_MASK		BIT(3)
#define PDMIC_DSPR0_SIZE_SHIFT		(3)

#define PDMIC_DSPR0_OSR_128		0x0
#define PDMIC_DSPR0_OSR_64		0x1
#define PDMIC_DSPR0_OSR_MASK		GENMASK(6, 4)
#define PDMIC_DSPR0_OSR_SHIFT		(4)

#define PDMIC_DSPR0_SCALE_MASK		GENMASK(11, 8)
#define PDMIC_DSPR0_SCALE_SHIFT		(8)

#define PDMIC_DSPR0_SHIFT_MASK		GENMASK(15, 12)
#define PDMIC_DSPR0_SHIFT_SHIFT		(12)

#define PDMIC_DSPR1	0x0000005c

#define PDMIC_DSPR1_DGAIN_MASK		GENMASK(14, 0)
#define PDMIC_DSPR1_DGAIN_SHIFT		(0)

#define PDMIC_DSPR1_OFFSET_MASK		GENMASK(31, 16)
#define PDMIC_DSPR1_OFFSET_SHIFT	(16)

#define PDMIC_WPMR	0x000000e4

#define PDMIC_WPSR	0x000000e8

#endif
net-next.git/tree/sound/ppc/burgundy.c?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>tree</a><a class='active' href='/cgit.cgi/linux/net-next.git/commit/sound/ppc/burgundy.c?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/sound/ppc/burgundy.c?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/sound/ppc/burgundy.c'>
<input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='030305d69fc6963c16003f50d7e8d74b02d0a143'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/commit/?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>root</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>sound</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound/ppc?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>ppc</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound/ppc/burgundy.c?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>burgundy.c</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='030305d69fc6963c16003f50d7e8d74b02d0a143'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Bjorn Helgaas &lt;bhelgaas@google.com&gt;</td><td class='right'>2017-01-27 15:00:45 -0600</td></tr>
<tr><th>committer</th><td>Bjorn Helgaas &lt;bhelgaas@google.com&gt;</td><td class='right'>2017-01-27 15:00:45 -0600</td></tr>
<tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/sound/ppc/burgundy.c?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>030305d69fc6963c16003f50d7e8d74b02d0a143</a> (<a href='/cgit.cgi/linux/net-next.git/patch/sound/ppc/burgundy.c?id=030305d69fc6963c16003f50d7e8d74b02d0a143'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>363a4e34d199178769b7e7eeb26ea2620a55847b</a> /<a href='/cgit.cgi/linux/net-next.git/tree/sound/ppc/burgundy.c?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>sound/ppc/burgundy.c</a></td></tr>
<tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/sound/ppc/burgundy.c?h=nds-private-remove&amp;id=4d191b1b63c209e37bf27938ef365244d3c41084'>4d191b1b63c209e37bf27938ef365244d3c41084</a> (<a href='/cgit.cgi/linux/net-next.git/diff/sound/ppc/burgundy.c?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143&amp;id2=4d191b1b63c209e37bf27938ef365244d3c41084'>diff</a>)</td></tr></table>
<div class='commit-subject'>PCI/ASPM: Handle PCI-to-PCIe bridges as roots of PCIe hierarchies</div><div class='commit-msg'>In a struct pcie_link_state, link-&gt;root points to the pcie_link_state of
the root of the PCIe hierarchy.  For the topmost link, this points to
itself (link-&gt;root = link).  For others, we copy the pointer from the
parent (link-&gt;root = link-&gt;parent-&gt;root).

Previously we recognized that Root Ports originated PCIe hierarchies, but
we treated PCI/PCI-X to PCIe Bridges as being in the middle of the
hierarchy, and when we tried to copy the pointer from link-&gt;parent-&gt;root,
there was no parent, and we dereferenced a NULL pointer:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000090
  IP: [&lt;ffffffff9e424350&gt;] pcie_aspm_init_link_state+0x170/0x820

Recognize that PCI/PCI-X to PCIe Bridges originate PCIe hierarchies just
like Root Ports do, so link-&gt;root for these devices should also point to
itself.

Fixes: 51ebfc92b72b ("PCI: Enumerate switches below PCI-to-PCIe bridges")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=193411
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1022181
Tested-by: lists@ssl-mail.com
Tested-by: Jayachandran C. &lt;jnair@caviumnetworks.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
CC: stable@vger.kernel.org	# v4.2+</div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?h=nds-private-remove&amp;id=030305d69fc6963c16003f50d7e8d74b02d0a143'>Diffstat</a> (limited to 'sound/ppc/burgundy.c')</div><table summary='diffstat' class='diffstat'>