Source: InvenSense.

It's been a rough start to the year for InvenSense (INVN) investors. Shares tumbled as much as 19% in the first two weeks of the year. Earlier this month, InvenSense was hit with several class action lawsuits regarding its fiscal second-quarter earnings forecast.

InvenSense's slide began after its second-quarter earnings report in October came in well below expectations. The biggest culprit was its gross margin, which fell to 37%, below the company's forecast of around 50%. That result led to a slew of lawsuits claiming the company -- which designs, develops, markets, and sells micro-electro-mechanical system (MEMS) gyroscopes for motion tracking devices in consumer electronics -- misled investors.

But another piece of news broke recently that's getting overshadowed. InvenSense customer Samsung (NASDAQOTH: SSNLF) previewed its fourth-quarter earnings results, and its mobile division disappointed once again. That Apple (AAPL -0.81%) contract that InvenSense secured last year is looking more valuable now, even if it's putting pressure on margins.

Bigger than Apple
In InvenSense's first quarter, Samsung orders made up 30% of its total revenue. The company had only two other companies account for more than 10% of revenue: Xiaomi accounted for 10%, and LG accounted for 12%.

In the second quarter, Samsung still made up 29% of the company's total revenue despite InvenSense's adding Apple as a customer, which made up 26% of revenue. No other companies accounted for more than 10% of revenue.

Despite Samsung's struggles, InvenSense was able to increase its revenue from the Korean company by $6.15 million. Samsung's smartphone shipments fell an estimated 8.2% in its third quarter, and mobile revenue declined 15% sequentially. Still, InvenSense seems to have made up for Samsung's issues by winning a larger share of its MEMS orders and/or increasing the average number of sensors per device.

But uncertainty in Samsung's mobile division is lingering, and there's not much share left for InvenSense to capture. The Wall Street Journal reports that the company likely saw a decline in handset shipments in the fourth quarter compared to the third quarter despite the rollout of the Galaxy Note 4 and the Galaxy Alpha. That means InvenSense could suffer a decline in revenue from its biggest customer, especially considering Samsung was likely still unloading Galaxy S5 stock that it overbought in the first half of the year.

But there's good news
While Samsung has made up a huge percentage of InvenSense's revenue in the past, InvenSense has been able to attract at least one of the companies that's cutting into the Korean electronics giant's market share.

InvenSense is well-positioned to leverage its smartphone contracts into wearable contracts. Source: InvenSense

Xiaomi is the fastest-growing smartphone OEM, increasing sales 211% in the third quarter last year to become the third-largest smartphone maker in the world. While it still trails Samsung by a significant amount, that's somewhat beneficial for InvenSense. Xiaomi is currently in the sweet spot for the MEMS maker where it's not quite big enough to put significant pricing pressure on InvenSense, but it still provides a significant amount of revenue. Last quarter, Xiaomi didn't reach the 10% of revenue threshhold to require a disclosure, but it's still a large customer for InvenSense. 

InvenSense also has contracts with LG, which accounted for 10% of its total revenue in the first half of fiscal 2015. LG sold nearly as many phones as Xiaomi in the third quarter of 2014.

But the biggest revenue generator going forward is probably Apple. Despite the margin pressure that the iPhone maker is putting on InvenSense, Apple presents a huge opportunity going forward. 

In the quarter when Apple launched the new iPhone models, InvenSense generated about $23.5 million in sales to Apple. It's not clear how many units that includes, but it seems like the MEMS maker is receiving significantly less than the average $1 per 6-axis chip CEO Behrooz Abdi told investors InvenSense receives from OEMs in the company's first quarter earnings call. It was expected that Apple would receive better-than-average pricing due to its high volume of orders, but the picture isn't clear on how much Apple pays per unit.

Still, The iPhone 6 and iPhone 6 Plus are selling extremely well, and the upcoming Apple Watch now has a much stronger potential to include InvenSense chips. The Apple Watch could spur sales of wearables as a whole, and InvenSense is well-positioned to capitalize on that trend with design wins in some of the most popular wearable devices already.

Thinking long term
Despite the decline in sales of one of its biggest customers, and a warning that last quarter's sales at Samsung likely declined further, InvenSense is still well-positioned for long-term growth. It's already secured strong positions with Xiaomi and LG, as well as its new position with Apple, which continues to increase smartphone sales year after year. There's also its position in wearable devices, which are expected to grow significantly during the next five years.

Margins probably won't return to the mid-50% forecast the company originally stated as its goal last year due to the impact of the Apple contract. However, investors should expect margins to climb back into the high 40% range as yields on its new six-axis sensor improve.

I'd rather own a company producing $100 million in revenue per quarter with a 45% gross margin than a company producing $60 million in revenue per quarter with a 55% gross margin. The latter is where InvenSense was before the Apple contract; the former is where InvenSense is headed next fiscal year.